Health settable via script

Health settable via script

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Health settable via script

Post by Dragon45 »

Download Link: http://fileuniverse.com/?page=showitem&ID=1049

For the coders:
On line 816 in CobInstance.cpp, add the line

Code: Select all

unit->health = ((param/100.0f)*unit->maxHealth);
it should be in the SetUnitVal function definition after the "case HEALTH:" and before the "break".



For the modders:
Use the syntax

Code: Select all

set HEALTH to 25;
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

Code: Select all

set HEALTH to 300;
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.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

heh, sorry to rez, but this will make kill scripts work now (Have script detect when a unit is at very low health, have a nice little death animation, then set the health to 0)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Have the SY's given support for this to be included in the engine? Or will ti be assigned to project forks and custom executables?
Post Reply

Return to “Game Development”