OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Olle Stolpe on 25 Feb 2005, 12:10:22

Title: Reduce dammage by dammage-0.5
Post by: Olle Stolpe on 25 Feb 2005, 12:10:22
I'm trying to alter a script in which you inflict dammage to a nearby Unit.

In the script it sets dammage = 1 on the target. But I want it to just subtract 0.5 from
the dammage. So that every time you use the script the targets dammage is reduced
by 0.5.

I tried something like this.

var = getdammage _target
_target setdammage var-0.5

The original was:

_target setdammage 1

But it won't do the trick.. Any ideas?
Title: Re:Reduce dammage by dammage-0.5
Post by: dmakatra on 25 Feb 2005, 12:30:31
You mean like this?

_get = getdammage _target
_get = _get - 0.5
_target setdammage _get

I'm not sure I followed what you wanted.

:beat: *Gets Shot* :beat:
Title: Re:Reduce dammage by dammage-0.5
Post by: THobson on 25 Feb 2005, 15:14:13
I have just been doing this only I wanted to get a loon that was too damaged to walk just well enough to stand.  The code I am using is:

while {not (canStand _loon)} do {_loon setDammage (getDammage _loon - 0.01)}  

dmakatra is correct.  You could also do it in one line as follows:

_target setDammage (getDammage _target - 0.5)