Jump to content
Blitzen88

Trouble calling a function from a trigger

Recommended Posts

Good morning.

 

Im trying to have a trigger repeatedly call a function when the trigger countdown reaches zero.  I placed the trigger (with no conditions) with a countdown.  The trigger counts down but the function (spawn a helicopter) never activates.  I added a condition to the trigger (opfor capturing a sector) and the function activated.  However, I want the trigger to activate repeatedly.  Even when the condition is met, the function is only called one time.  Is there anyway to have a trigger countdown repeatedly and call the function everytime the countdown reaches zero?

 

Thank you

Share this post


Link to post
Share on other sites

Can we write a script and exec that script via the trigger? I think that's how I've solved this in the past.

What code do you exec on trigger?

Share this post


Link to post
Share on other sites

Two ways:

Do not repeat the trigger, but add a loop for your sqf:

while {true (or some condition)} do {sleep 5 (or your trigger countdown); spawn your helo code }

 

repeat the trigger, but rearm it:

cond: your condition && isnil "aVariable"

on activation : your sqf; aVariable = TRUE

(so you spawn but deact at once because aVariable is no more nil)

on deactivation:

0 = [] spawn {sleep 5 (or what ever delay to rearm the trigger); aVariable = Nil };

(so if your condition is still met, the trigger will fire again).

 

  • 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

×