Jump to content
Sign in to follow this  
Tom_Anger

Countdown for Extraction Display question

Recommended Posts

Basic concept.  Get a team to a recon point and trigger a countdown for as long as at least 1 member is in the area.  I have an area trigger that works great and I am looking to add a countdown display to help the players know how much longer to hold the area.  I wrote a generic script that is activated when a member enters the area.  

Here is the activation code

On Act.

if (reconowner == "west") then {reconowner = "east";reconscript = [30] execVM "recon_countdown.sqf";}

Here is the script

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//_count is the countdown in seconds

_count = _this select 0;

// Main Procedure Logic

while {_count > 0} do

{

  hint format ["%1 contacting recon support.", _count];

  Sleep(1);

  _count = _count - 1;

};

hint format["%1",_count];

This works perfect when it is activated, however, I am trying to remove the display when all members are out of the area.  I have tested this with a deactivation line

On Dect:

reconowner = "west";hint "Situation unstable for extraction";

I do see the deactivation message pop up, but it is immediately replaced with the timer as it continues to countdown.  Any ideas on how I can rid of the countdown on a deactivation?  I was trying to research the Timeout and Countdown features on triggers to see if there was some internal variable to use, but came up empty on that.

Share this post


Link to post
Share on other sites

You need to stop the countdown script with terminate

So, add the following code to the onDeAct line

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">terminate reconscript

Share this post


Link to post
Share on other sites

Hi Tom, I'm looking at doing something similar on a mission I'm writing. I've tried to follow what you have done but having no luck.

Could you explain ( in basic terms wink_o.gif , how you set up your triggers? As I have set a trigger with your on act but nothing happens??? Do I need to name the trigger.

I named the script "recon_countdown.sqs"

Any help gratefully excepted.

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  

×