Jump to content
  • 0

Changing max health / armor ingame


NinjaLiquidator

Question

Hello, I just got random idea - and now I am fine even with Zdoom compatibility, not just PrBoom.

There is a max health you can obtain by medkit, max health you can obtain by supercharge, max armor you can obtain by green and blue armors.

Is there a way how to modify those limits ingame? I want to split every damage you take into healable and non-healable one. You have 100 health, and you get 10 damage? Then 5 will be healable and 5 not (medkit will heal only to 95 from that time). Any way to do that?

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 1

A quick way would be to use an ACS function like HealThing. Instead of a pickup giving a pickup effect to the player doing the pickup, it kicks off a script that uses HealThing to change the player's health. The amount and max amount are thus modifiable by your own logic kept within ACS.

Share this post


Link to post
  • 1
1 hour ago, NinjaLiquidator said:

And is there a way to do such a function even on taking a damage?

Are you asking if ACS can be used to parse damage into healable and non-healable damage? I believe it can be done, but you might be better off just creating a new player class in DECORATE (or ZScript) where this behavior is natively defined.

Share this post


Link to post
  • 1
15 hours ago, NinjaLiquidator said:

a function even on taking a damage?

 

If you want to know how much damage a thing/player just took, you can just compare the properties 'spawnhealth' versus 'health' with GetActorProperty and adjust your ACS logic accordingly. Obviously this does not take powerups like Supercharge into account and looks to me quite finicky and error-prone to use on stuff like the player. If you want to do stuff on player taking damage, just call an ACS script from the player's Pain frames, with the same objections as noted above.

 

You might be better off following Rex's suggestion on doing this with ZScript, which allows you to overwrite native behaviours instead of circumventing them with ACS.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...