OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Delta83_DK on 26 Apr 2011, 23:58:33

Title: Stupid newbie question
Post 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 :
Code: [Select]
grp1 = group this in the leaders init field.
Then in the Act. Field of a trigger :
Code: [Select]
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  :)
Title: Re: Stupid newbie question
Post by: i0n0s on 27 Apr 2011, 00:40:22
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:
Code: [Select]
{
  _x setDamage 1;
} forEach units grp1;
Title: Re: Stupid newbie question
Post by: Delta83_DK on 30 Apr 2011, 02:52:32
Thx for the quick and very helpful reply  :good: