Health settable via script
Posted: 25 Jun 2005, 01:00
Download Link: http://fileuniverse.com/?page=showitem&ID=1049
For the coders:
On line 816 in CobInstance.cpp, add the line
it should be in the SetUnitVal function definition after the "case HEALTH:" and before the "break".
For the modders:
Use the syntax
to set the health to to a percentage of its max health. In this case, the health is set to 25% of the max health. You can use more than 100% too, so something like
would set the unit's health to 3 times its maximum value.
IMHO, this should be made a part of standard/regular Spring, since it in no way breaks the old units, but really extends modding potential.
For the coders:
On line 816 in CobInstance.cpp, add the line
Code: Select all
unit->health = ((param/100.0f)*unit->maxHealth);
For the modders:
Use the syntax
Code: Select all
set HEALTH to 25;
Code: Select all
set HEALTH to 300;
IMHO, this should be made a part of standard/regular Spring, since it in no way breaks the old units, but really extends modding potential.