Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help World Timer?
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#4
RE: World Timer?

It's eminently possible! Smile

Like FlawlessHappiness was getting at, just use a looping timer. But you can just increment the global variable, like so:

PHP Code: (Select All)
void OnStart()
{
      
AddTimer("GlobalClockTimer"1"IncrementGlobalClock");
}

void IncrementGlobalClock(string &in asTimer)
{
      
SetGlobalVarInt("GlobalClock"GetGlobalVarInt("GlobalClock") + 1);
      
AddTimer("GlobalClockTimer"1"IncrementGlobalClock");


You could also make it count down, or use floats and a shorter delay to make it more accurate.

(This post was last modified: 08-31-2014, 04:57 PM by MrBehemoth.)
08-31-2014, 04:55 PM
Find


Messages In This Thread
World Timer? - by i3670 - 08-31-2014, 01:58 PM
RE: World Timer? - by FlawlessHappiness - 08-31-2014, 02:14 PM
RE: World Timer? - by DnALANGE - 08-31-2014, 04:21 PM
RE: World Timer? - by MrBehemoth - 08-31-2014, 04:55 PM
RE: World Timer? - by i3670 - 08-31-2014, 05:19 PM
RE: World Timer? - by FlawlessHappiness - 08-31-2014, 05:46 PM
RE: World Timer? - by i3670 - 08-31-2014, 05:46 PM
RE: World Timer? - by Mudbill - 08-31-2014, 07:48 PM
RE: World Timer? - by MrBehemoth - 08-31-2014, 09:17 PM



Users browsing this thread: 1 Guest(s)