OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: 456820 on 15 Sep 2007, 21:51:48

Title: Triggers arent deleting...
Post 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.

Code: [Select]
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:
Code: [Select]
this and param1 == 3 or param1 == 4ON ACTIVATION:
Code: [Select]
{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.
Title: Re: Triggers arent deleting...
Post by: Spooner on 16 Sep 2007, 12:37:11
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):
Code: [Select]
this and param1 == 3 or param1 == 4 // This acts as "(this and param1 == 3) or param1 == 4
Should be
Code: [Select]
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,
Code: [Select]
{deletevehicle _x} foreach thislist;

I'm sure it is the latter issue that is causing your problem, but the former is good practice anyway.
Title: Re: Triggers arent deleting...
Post by: 456820 on 16 Sep 2007, 15:11:13
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.