Jump to content
Sign in to follow this  
druminator

Show countdown timer before mission ends?

Recommended Posts

Is there a way to show a countdown timer visible on screen? For example: A unit enters a trigger and a clock appears telling everyone that 10 mins are left on the mission? and after that the mission ends.

The countdown in the trigger and the countdown module works great but you never see the actually countdown so it would be neat if you could do that.

Any hints would be most welcome! :)

Share this post


Link to post
Share on other sites

You could try a display like this:

put inside description.ext:

class RscTitles
{
class RscText
{
access = 0;
type = CT_STATIC;
idc = -1;
style = ST_LEFT;
w = 0.1; h = 0.05;
//x and y are not part of a global class since each rsctext will be positioned 'somewhere'
font = "TahomaB";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text = "";
fixedWidth = 0;
shadow = 0;
};


class TIME_TEXT: RscText
{
	idd = 10000; 
	duration = 10000000; 
	onload ="uiNamespace setVariable [""TAG_TIMEBAR"", _this select 0];"; 
	text = "Test"; //--- ToDo: Localize;
	x = 0.434375 * safezoneW + safezoneX;
	y = 0.864 * safezoneH + safezoneY;
	w = 0.118125 * safezoneW;
	h = 0.042 * safezoneH;
	sizeEx = 0.85;
};
};

you'll need to use a few dialog/display commands in order to get it to display what you want though and I don't have time to explain it further but its a start.

Share this post


Link to post
Share on other sites

Thx for the tips! I'm not really sure what to do with "triggerTimeoutCurrent though", as of now my objective is pretty simple: The first unit to enter the area/trigger sets a visible timer that counts down from 10mins and after that the mission ends.

No hurry austin_medic! I have put the code in my description.ext but what does that really do?

Sry i'm a bit rusty when it comes to scripting. As of right now I have the End Scenario Module synced with a trigger set on 10mins.

Share this post


Link to post
Share on other sites
Thx for the tips! I'm not really sure what to do with "triggerTimeoutCurrent though", as of now my objective is pretty simple: The first unit to enter the area/trigger sets a visible timer that counts down from 10mins and after that the mission ends.

No hurry austin_medic! I have put the code in my description.ext but what does that really do?

Sry i'm a bit rusty when it comes to scripting. As of right now I have the End Scenario Module synced with a trigger set on 10mins.

Basically it creates a dialog but doesnt take away control from the players movement. It's a display that has a rscText control which lets you display text on it, then you can set the text control on the display to whatever you want.

If your looking for a dirty simple solution you could just set up your time as a string then countdown using hint in a loop.

Though you'll need a function to convert from seconds into minutes and seconds.

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  

×