Difference between Stamina and BonusHealth

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Difference between Stamina and BonusHealth

Post by Player701 »

Is there any gameplay-related differences between these two properties? I know that Stamina is a property of Actor, while BonusHealth is a property of PlayerPawn. Other than that, and the fact that Stamina is used in some Strife items (since it apparently came from there initially), the only two places I've found where BonusHealth is mentioned on its own are:
  • In p_mobj.cpp::GetRealMaxHealth on line 1475, though even in that case I'm not quite sure if it should be like that (other branches in that function use the sum of Stamina and BonusHealth, so maybe it's a bug?).
  • There is an actor called "MaxHealth" in gzdoom.pk3, which appears to increase the player's maximum health in a similar way UpgradeStamina does. So far I haven't found out where it is used, if at all. The wiki doesn't seem to know about this class either.
In all other places where BonusHealth is mentioned, it is always added to Stamina so these values seem to be "paired" with each other (not considering that Stamina is also used in some Strife-related code).

Searching the forums for "BonusHealth" doesn't give anything interesting - a recent crash report and an ancient thread from 2004. What I would like to know is which one of these two properties should be given preference in new mods when creating powerups which increase the player's maximum health. They seem to work absolutely identically...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Difference between Stamina and BonusHealth

Post by Graf Zahl »

Stuff like this happens if you want to support two ideas from different sources at the same time.
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Difference between Stamina and BonusHealth

Post by Player701 »

And in this case, what was the other idea and what source did it come from? I see that these properties both deal with increasing the maximum amount of health the player can have. I wouldn't ask if there were a clear distinction...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Difference between Stamina and BonusHealth

Post by Graf Zahl »

Stamina comes from Strife, BonusHealth from Skulltag.
These are different fields for the sole reason that both concepts are not compatible.
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Difference between Stamina and BonusHealth

Post by Player701 »

Hmm... was my post deleted for some reason? I haven't received any messages from moderators, so I hope I didn't violate any rules. Let's assume I somehow forgot to press the "Submit" button. Whatever...

Anyway, thanks for explaining this to me, Graf. I guess I should go with BonusHealth in my mod, considering that it isn't tied to any hard-coded Strife stuff like Stamina is. It's always better to be on the safe side when it comes to such things, IMO.

BTW, is the C++ code I linked to in the first post correct? It just seems a little weird that everywhere else in that function where a similar check is made, Stamina is taken into account, but it's not the case for the last "else" branch.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Difference between Stamina and BonusHealth

Post by Matt »

What special hard-coded stuff is associated with stamina? I've just been using it as an arbitrary spare integer variable all this time :oops:
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Difference between Stamina and BonusHealth

Post by Rachael »

I think you just forgot to press submit, or the submit wasn't successful. There's no log entries that the post ever existed, or for that matter got deleted.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Difference between Stamina and BonusHealth

Post by Graf Zahl »

Matt wrote:What special hard-coded stuff is associated with stamina? I've just been using it as an arbitrary spare integer variable all this time :oops:

It affects the damage of Strife's dagger weapon and can be used by custom weapons for that as well.

Return to “Scripting”