OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: redmotion on 16 Oct 2010, 12:09:10
-
I'd like to create a trigger in script that is put down in the location of a marker (placed in the editor). And that can only be activated by the player. Thing is, I can't even work out what type of trigger to create.
The script below runs without errors but doesn't give me a trigger that works. I've tried numerous versions of this - changing the type and activation options - but with no success.
_pos = getMarkerPos "BaseMarker5";
basetrigger = createTrigger ["SWITCH", _pos];
basetrigger setTriggerActivation ["WEST", "PRESENT", false];
basetrigger setTriggerArea[100,100,0,false];
basetrigger setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];
Thanks for you time.
-
Try using:
basetrigger = createTrigger ["EmptyDetector", _pos];That's the 'default' trigger type.
Can't see anything else that would be problematic :)
-
:scratch:
The trigger will get activated by all WEST units that enter the area:
basetrigger setTriggerActivation ["WEST", "PRESENT", false];
...
basetrigger setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];
If I got you right, this is not what you want. Try something like this:
1. Make the trigger report any unit who enters the area (setTriggerActivation (http://community.bistudio.com/wiki/setTriggerActivation)).
2. Only activate if the player is one of the units that got reported (setTriggerStatements (http://community.bistudio.com/wiki/setTriggerStatements))
basetrigger = createTrigger ["EmptyDetector", getMarkerPos "BaseMarker5"];
basetrigger setTriggerActivation ["Any", "Present", false];
basetrigger setTriggerArea [100, 100, 0, false];
basetrigger setTriggerStatements ["player in thisList", "hint 'trigger on'", "hint 'trigger off'"];
-
@Worldeater: Thank you so much. That worked straight away. That has been killing me for a week! Thanks again.