I need the maximum health of a unit including veterancy bonus.
I tried the Spring.GetUnitHealth function but that didnt work and i dont know even if thats the right function for that since i couldnt make much sense out of the discription.
Getting maximum health.
Moderator: Moderators
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: Getting maximum health.
http://springrts.com/wiki/Lua_SyncedReadSpring.GetUnitHealth
( number unitID ) -> nil | number health, number maxHealth, number paralyzeDamage,
number captureProgress, number buildProgress
The function returns multiple return values. You might be looking just at the first one. Try
Code: Select all
health, maxHealth = Spring.GetUnitHealth(...)
Re: Getting maximum health.
But does that return nominal maximum health or the current (veteran bonus corrected) one? I think it returns the current maxhealth. If so, how does one get the nominal one?
Re: Getting maximum health.
UnitDefs[unitDefID].healthJools wrote:But does that return nominal maximum health or the current (veteran bonus corrected) one? I think it returns the current maxhealth. If so, how does one get the nominal one?