Is it possible to change HP by script?

Is it possible to change HP by script?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Is it possible to change HP by script?

Post by Optimus Prime »

Hi

is it possible, to change the MaxDamage value by scripting? So for example after some time the unit gets more HP or so. If yes, how can i do that?
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Since units like the Annihilator enable a damage absorption when closed, it is possible because 50% damage absorption is the same as a unit with doubled life.

Still, there may be a better solution since it will continue to show the unit has having x HP which would be missleading.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

That only works for a previous version of Spring, I believe
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

If you read the comments below, its now been merged with the main Spring build for quite some time. So it should work without any modification.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

cool! Thank you very much :)
Is there anywhere a database for the methods and parameters you can use by standard for the scripts?
So i wouldnt need to ask here when i have a question...

Edit: Another question: How can i read the maxDamage value? I mean not in % but a real number.. for example 4938 HP?
I think request Health gets only the % value.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

No, that change has not made its way into the official Spring release yet. And it's only for the current hp, not the max hp.

And yeah, just use damagemodifier=0.2; in the FBI and set ARMORED to TRUE; in the script to gives x5 hp to your unit (althought that's the TA way, I have not checked in Spring).
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

Ok. But think of this future... you could make evolving ships and experience levels which would add more weapons and even change the model of the ship.
I wanted to make the commanders gain extra weapons and hullparts when reaching a fixed exp :)
Post Reply

Return to “Engine”