Home   Help Search Login Register  

Author Topic: Reduce dammage by dammage-0.5  (Read 462 times)

0 Members and 1 Guest are viewing this topic.

Olle Stolpe

  • Guest
Reduce dammage by dammage-0.5
« 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?

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Reduce dammage by dammage-0.5
« Reply #1 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:

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Reduce dammage by dammage-0.5
« Reply #2 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)
« Last Edit: 25 Feb 2005, 15:15:04 by THobson »