Home   Help Search Login Register  

Author Topic: Damaging All Units in Trigger  (Read 564 times)

0 Members and 1 Guest are viewing this topic.

imemyself

  • Guest
Damaging All Units in Trigger
« on: 12 Apr 2003, 01:06:00 »
OK,I'm trying to damage people that are within about 30 meters I guess from a point where a smokeshell is created.  I'm trying to create a simple chemical weapons script.  I created triggers in the Mission Editor, named them and then they are just moved to the position I where the smokeshell is.  I have it set so on activation it stores the contents of thisList to a variable(med).  In the external script I want it to do stuff to the people activated the trigger.  I had it do this:

Code: [Select]
"_x setdamamge(damage _x+random 0.1)" foreach units List med;

med was the variable I stored thisList to.  Now when I do the mission it comes up and says that it can't do it since List med is an array and the foreach think only works on units or groups.  Can any kind person out there help me?




deaddog

  • Guest
Re:Damaging All Units in Trigger
« Reply #1 on: 12 Apr 2003, 05:46:44 »
Remove the Units command.  forEach works on arrays, not units or groups.  That's why you need the units command normally.  It generates an array of all units in a group.

The List command generates an array of all units that would activate the trigger.

 :)
« Last Edit: 12 Apr 2003, 05:49:29 by deaddog »