HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is there any way to set maximum life of a unit?

10-14-2002, 09:59 PM#1
Ari
I'm trying to set the maximum life of a non-hero unit. Oddly, there's a trigger refering to max-life, but no way to modify it in-game. Strange indeed, considering that you *can* set the max life of a doodad using triggers. I'd consider simply replacing a unit with a new similarly modeled unit with higher max life, but I'm adding a level-up type effect, and so would need multiple versions of each unit.

The only thing I can think of is to make my max life very high, and simply use triggers to ensure that a unit's HP's never exceed my "true" max life setting (which can itself be raised using triggers). That is, with a "hard" max life of 10000, if I have a "true" max life of 1000, I can raise that number, and prevent a unit from ever exceeding this lower max.
But this is pretty lame. It's awkward to code and is going to give all of my units red life-bars even when at "full" health. Can anyone think of a more elegant solution to this problem?
10-14-2002, 11:48 PM#2
The_Cyberdemon1
Well, you could make a new unit, and when you upgrade to a new amount of life (or whatever), replace it with that unit. You can keep the life amount the same with the unit-replace trigger. I actually have dont that in a bad map that i deleted cuz it was dumb (but don't get down). The one bad thing about that would be if the life amount is player-defined. If so, you better just do the "less elegant" way. Well, good luck :D!
10-14-2002, 11:49 PM#3
The_Cyberdemon1
Want a sig? Just e-mail me
10-15-2002, 01:29 AM#4
Draco
Yeah I wnated to do that once to non-hero units, but the only solution I could think of was switching it to a similar unit with higher hp.