The ObjectTemplate.SetHealth property

Ask questions, discuss ideas, get answers
Post Reply
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

The ObjectTemplate.SetHealth property

Post by Diamondback »

http://bfmods.com/mdt/scripting/ObjectT ... ealth.html

I'm trying to create ''one time'' health packs for my death match add-on. Basically what I mean by ''one time'' is that the soldiers that pick up the health pack don't get healed every second, instead, I want their health to replenish by 25% increments, meaning if you stand over the health pack your health will increase by 25%, and that happens only ONCE. The soldiers may only re-heal by leaving the heal radius and going back into it, but I plan to fix this issue to prevent people camping the health packs.

Reading the definition of the property and the range of it's arguments, setting the first number to -1 means you get continually healed. By setting this to 0 or another value, a soldier would get only one heal, and not an infinite amount of heals. The second value is the amount of health the soldier gets healed, in my case I want 25% health increments so I would set this to 25. The third argument I would set to 0 as I don't want the health packs to be resupplied and only offer health to soldiers once.

I have yet to try those settings so if anyone has already tried fiddling with this property and using different values than the default values, please let me know if it worked or crashed.
See my Strasbourg map project here.
Post Reply