Home   Help Search Login Register  

Author Topic: Stupid newbie question  (Read 1642 times)

0 Members and 1 Guest are viewing this topic.

Offline Delta83_DK

  • Members
  • *
Stupid newbie question
« 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  :)

Offline i0n0s

  • Moderator
  • *****
Re: Stupid newbie question
« Reply #1 on: 27 Apr 2011, 00:40:22 »
setDamage only works on units. See 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;

Offline Delta83_DK

  • Members
  • *
Re: Stupid newbie question
« Reply #2 on: 30 Apr 2011, 02:52:32 »
Thx for the quick and very helpful reply  :good: