OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Delta83_DK on 26 Apr 2011, 23:58:33
-
Hey Guys
I have kind of a stupid question.
I have already looked around in the forum, and it should be straight forward, however I am experiencing some problems.
I am trying to name my group using : grp1 = group this
in the leaders init field.
Then in the Act. Field of a trigger : grp1 setdammage 1
Nothing happens when the trigger is activated.
However if I type grp1 in the name field of a unit, it works fine, but only on that unit.
I would like to be able to use a trigger that effects an entire group.
What am I doing wrong?
Any help would be greatly appreciated :)
-
setDamage only works on units. See http://community.bistudio.com/wiki/setDamage (http://community.bistudio.com/wiki/setDamage)
To get the units of a group you can use the "units" command which will return an array.
Then you simple iterate over the array:
{
_x setDamage 1;
} forEach units grp1;
-
Thx for the quick and very helpful reply :good: