Taylor1984 14 Posted April 23, 2018 Hi! Is there a way of preventing a unit from activating a repeatable trigger more than once? I still want the trigger to be able to activate when other units enter it afterwards. Thanks Share this post Link to post Share on other sites
HazJ 1288 Posted April 23, 2018 So, you don't want it to activate again for that specific player who has already triggered it? Share this post Link to post Share on other sites
theend3r 83 Posted April 23, 2018 Yeah, of course. Create an array of units that already activated it and add a condition that units that can activate it can't be in said array. Share this post Link to post Share on other sites
HazJ 1288 Posted April 23, 2018 Okay. Something like: Not tested! someArr = []; someArr pushBack player; if !(player in someArr) then { // do whatever... }; someArr pushBack (name player); if !(name player in someArr) then { // do whatever... }; Share this post Link to post Share on other sites
f2k sel 164 Posted April 24, 2018 Alternative to creating an array would be to use setvariable/getvariable to tag the Unit. Cond {!(_x getvariable ["trig",false])} count thislist >0 On Act {_x setVariable ["trig",true]} foreach thislist Probably not the best method but it did work for me. 2 Share this post Link to post Share on other sites
Taylor1984 14 Posted April 24, 2018 21 hours ago, f2k sel said: Alternative to creating an array would be to use setvariable/getvariable to tag the Unit. Cond {!(_x getvariable ["trig",false])} count thislist >0 On Act {_x setVariable ["trig",true]} foreach thislist Probably not the best method but it did work for me. Thanks, it worked :) Share this post Link to post Share on other sites
Larrow 2797 Posted April 25, 2018 Trigger script commands are EL( local effect only ). So if you change an editor placed trigger at runtime( e.g through initPlayerLocal.sqf ) it will only apply to the trigger on the machine you made the changes from. You can for instance take a reference to an editor placed trigger and change its Activation to "VEHICLE" and Repeatable to False, then add the local client( player ) as the attached vehicle. The trigger will then only activate for this client, by this client, once. //initPlayerLocal.sqf params[ "_player" ]; //Wait for mission to start waitUntil { time > 0 }; //Get a reference to the editor placed trigger _trigger = NameGivenToTriggerInEditor; //Reassign it as active to the attached vehicle only, set unrepeatable _trigger setTriggerActivation [ "VEHICLE", "PRESENT", false ]; //Set local player as triggers attached vehicle _trigger triggerAttachVehicle [ _player ]; 2 Share this post Link to post Share on other sites
R3vo 2652 Posted April 26, 2018 Wouldn't it suffice to delete the trigger locally after it was activated? Share this post Link to post Share on other sites