Jump to content
Sign in to follow this  
bwf_ares

Repetitive countdown

Recommended Posts

Hello,

I'm editing a mission that appears simple but the ttrigger needed is not :s

2 camps must hold a small town (Bonanza) for 2 minutes. When a camp enters the town, a countdown starts, and if an enemy enters the town, the countdown stops. When the threat is destroyed, the countdown starts over...

It seems easy but I can't figure out how to handle this with the triggers???

Has someone solved that kind of problem already?

Share this post


Link to post
Share on other sites

You cant solve it with triggers cause you need to use 2 triggers, a publicvarable and a script that countsdown and checks the variable.

Share this post


Link to post
Share on other sites

And someone has already written such a script ? :s

Share this post


Link to post
Share on other sites

In your trigger for the camp present, in the OnAct put []exec "hold.sqs" . Name the script below hold.sqs.

Make another trigger for the enemy present and in the OnAct field put                 threat = 1;publicvariable "threat"

In the DeAct field put               threat = 0;publicvariable "threat"

Make an init.sqs and put this in.....

threat = 0

publicvariable "threat"

The script below will start a count when you enter the trigger and check for enemy in the trigger every 5 seconds for 2 mins.

;hold.sqs 2 minute countdown with a check for enemy every 5 sec.

#loop

~3

_count = 0

?threat == 0 : goto "countdown"

goto :loop"

#countdown

~5

?_count == 24 : goto "done"

?threat == 1 : goto "loop"

#check

?threat == 1 : goto "loop"

?threat == 0 : goto "countdown"

_count = _count + 1

#done

exit

Share this post


Link to post
Share on other sites

Wow, thanx alot, that's exactly what I was looking for, I'm trying it right away smile_o.gif

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
Sign in to follow this  

×