Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
REVERSE time counting #168292
11/19/07 21:34
11/19/07 21:34
Joined: Sep 2006
Posts: 188
Latvia
MDI Offline OP
Member
MDI  Offline OP
Member

Joined: Sep 2006
Posts: 188
Latvia
I know how to make timer who works like normal hronometr( withseconds and miliseconds), but how to get this reverse.
This i need for my game, where terrain makes timeout for moving further and in corner shows waiting time.

OK then to you all this is clear - any ideas? because i know when this is possible!


Latvija rullē
Re: REVERSE time counting [Re: MDI] #168293
11/20/07 21:03
11/20/07 21:03
Joined: Sep 2006
Posts: 188
Latvia
MDI Offline OP
Member
MDI  Offline OP
Member

Joined: Sep 2006
Posts: 188
Latvia
OK!! No problem! I think im solve this problem.
Have i say all is possible.


Latvija rullē
Re: REVERSE time counting [Re: MDI] #168294
11/20/07 21:11
11/20/07 21:11
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
sorry for responding late, and although it seems that you have found a solution I'd like to post a possible solution for people who find this thread using the search function afterwards:

Basicly all you do is first setting the starting time and then subtract from it as long as it is above zero.
My example will use "seconds" as time measurement.
The variable "total_secs" stores the time in seconds which is still left.
My example does not take care of converting this to minutes.
Code:

// !!! Aware: C-Script Code !!!

var total_secs = 0;

function timer_start(_seconds)
{
total_secs = _seconds;

while(total_secs > 0)
{
wait(-1);
total_secs -= 1;
}
}

function timer_stop() //use this function to force the timer to stop
{
total_secs = 0;
}

// Start the timer like this. (example uses 2 minutes as start value)
timer_start(120);



REVERSE time counting [Re: Xarthor] #168295
11/20/07 21:51
11/20/07 21:51
Joined: Sep 2006
Posts: 188
Latvia
MDI Offline OP
Member
MDI  Offline OP
Member

Joined: Sep 2006
Posts: 188
Latvia
Thanks! This is very simple!
I done this in much more complex way - with seconds, miliseconds who use total_ticks and so on!
Although even no needs for something so complex if all can do very simly! OR NOT!


Latvija rullē

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1