OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: fragsta on 24 May 2003, 21:40:21

Title: setdammage, adddammage?
Post by: fragsta on 24 May 2003, 21:40:21
When you want to make a particular object damaged more when something happens, how do you do it? I want it so that if something is destroyed it will affect something else's health, but not quite kill it. I could just make it so that it sets the damage with setdammage, but what if the thing i want to be damaged is already destroyed? It would have a reverse effect. So is there a way of adding damage onto something? such as
Code: [Select]
setdammage +0.2or something?

Thanx in advance!
Title: Re:setdammage, adddammage?
Post by: Komuna on 25 May 2003, 03:14:46
_Unit setdammage (getdammage _Unit)+0.2

Command combination... very useful! ;)
Title: Re:setdammage, adddammage?
Post by: macguba on 25 May 2003, 11:17:11
You can add a conditonal statement to ensure that _unit isn't killed.   For example, before Komuna's line have

? getdammage _unit > 0.7: _unit setdammage 0.7

so the adding of 0.2 of dammage will not kill _unit.
Title: Re:setdammage, adddammage?
Post by: fragsta on 25 May 2003, 11:49:12
kewl, thanks alot guys!