Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
NinjaLiquidator

Changing max health / armor ingame

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×