Luft08 27 Posted July 20, 2020 In a mission that I'm working on I create a trigger: colonelNearGuard = { private _return = false; if(officer_0 distance rifleman_0 < 3) then { _return = true}; _return }; saluteTrg = createTrigger["EmptyDetector", [0,0,0]]; saluteTrg setTriggerStatements["[] call colonelNearGuard", "[] execVM 'scripts\darknessFalls\server\officerAssignsJeep.sqf'", ""]; When the trigger fires the colonel is suppose to tell the guard on the jeep to release it to the players which he does. The problem is he does it over and over forever. I only want the trigger to fire once but the only way I know how to do that is with the setTriggerActivation command. However, my setTriggerStatements already has the activation condition and setTriggerActivation takes three parameters: by, type, repeating. By can be set to "NONE" but if I were to use this command what do I do with the Type parameter? I have tried deleting the trigger in the officerAssignsJeep method but it didn't fix it. It still repeats forever. Share this post Link to post Share on other sites
Harzach 2505 Posted July 20, 2020 saluteTrg setTriggerActivation ["NONE", "PRESENT", false]; When by is "NONE", type is meaningless. 1 1 Share this post Link to post Share on other sites
Luft08 27 Posted July 20, 2020 I though that the trigger was firing over and over because I didn't use setTriggerActivation to prevent the trigger from firing more than once but it still does. (no joy) colonelNearGuard = { private _return = false; if(officer_0 distance rifleman_0 < 3) then { _return = true}; _return }; saluteTrg = createTrigger["EmptyDetector", [0,0,0]]; saluteTrg setTriggerActivation ["NONE", "PRESENT", false]; saluteTrg setTriggerStatements["[] call colonelNearGuard", "[] execVM 'scripts\darknessFalls\server\officerAssignsJeep.sqf'", ""]; As a test I commented out the "if" in the in-line function and as expected the trigger does not fire. With the if statement the trigger continues to fire over and over. Am I doing something stupid?? I think I found the problem and yes, I was doing something embarrassingly stupid. 😞 Share this post Link to post Share on other sites
pierremgi 4736 Posted July 21, 2020 Are you sure that's the trigger? Any loop in your sqf? Share this post Link to post Share on other sites
mrcurry 468 Posted July 21, 2020 22 hours ago, Luft08 said: I though that the trigger was firing over and over because I didn't use setTriggerActivation to prevent the trigger from firing more than once but it still does. (no joy) colonelNearGuard = { private _return = false; if(officer_0 distance rifleman_0 < 3) then { _return = true}; _return }; saluteTrg = createTrigger["EmptyDetector", [0,0,0]]; saluteTrg setTriggerActivation ["NONE", "PRESENT", false]; saluteTrg setTriggerStatements["[] call colonelNearGuard", "[] execVM 'scripts\darknessFalls\server\officerAssignsJeep.sqf'", ""]; As a test I commented out the "if" in the in-line function and as expected the trigger does not fire. With the if statement the trigger continues to fire over and over. Am I doing something stupid?? I think I found the problem and yes, I was doing something embarrassingly stupid. 😞 The problem doesn't seem to be in the code that you have provided. Show the officerAssignsJeep.sqf script code as well. Share this post Link to post Share on other sites
Luft08 27 Posted July 21, 2020 Thanks everyone. I did find that in the officerAssignsJeep.sqf file my code was looping back on itself. ☹️ Everything is good now. 2 Share this post Link to post Share on other sites