OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: imemyself 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:
"_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?
-
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.
:)