Jump to content

Recommended Posts

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
saluteTrg setTriggerActivation ["NONE", "PRESENT", false];

When by is "NONE", type is meaningless.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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
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

Thanks everyone. I did find that in the officerAssignsJeep.sqf file my code was looping back on itself. ☹️ Everything is good now. 

 

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×