OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: 456820 on 15 Sep 2007, 21:51:48
-
Well I have a very big mission set up covering essentially the entire island.
I have included several triggers to remove certain areas of the island which can be chosen by the admin by slecting the parameter.
titleParam1 = Enemy;
valuesParam1[] = {1,2,3,4};
defValueParam1 = 1;
textsParam1[] = {Enemy North + South ,Enemy South , Enemy North, No Enemy};
Thats my description.ext bit which sets up the parameter.
Now the triggers are...
Set to repeatedly and Anybody present
CONDITION: this and param1 == 3 or param1 == 4ON ACTIVATION: {deletevehicle _this} foreach thislist; deletevehicle trig_setup1_1
I have 3 other triggers to match with the other parameter options all the same apart from the condition is changed.
When I play the game, doesnt matter what parameter I set it to the enemy are always there. Is there something wrong anywhere? Cheers.
Also this doesnt work in SP either.
-
For the condition, you need to be sure to take operator precedence into account (and binds higher than or, so currently, if param1 == 4, then the trigger might fire before thisList is filled, though I'm not sure it would matter in this particular case):
this and param1 == 3 or param1 == 4 // This acts as "(this and param1 == 3) or param1 == 4
Should be
this and (param1 == 3 or param1 == 4) // Alternatively, use "this and (param1 in [3,4])"
In forEach blocks, each iteration sets _x, not _this, to the item. Thus it should be,
{deletevehicle _x} foreach thislist;
I'm sure it is the latter issue that is causing your problem, but the former is good practice anyway.
-
Thanks, shall give this a go asap.
Shall report back
Edit - Ah damn it. Whilst copying the syntax into the triggers I realised why it wasnt working. mixed _x with _this, im more rusty then i thought.
Anyway works perfectly now. Thank you.