| 
		
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| World Timer? 
 
				Is it possible to have timer that runs through all of the maps? If you for instance were to place the timer in the global.hps, would it work?
			 
 |  |  
	| 08-31-2014, 01:58 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: World Timer? 
 
				 (08-31-2014, 01:58 PM)i3670 Wrote:  Is it possible to have timer that runs through all of the maps? If you for instance were to place the timer in the global.hps, would it work? 
Placing it in the global.hps is just worth trying. I don't know if that'll work.
 
But it is possible, by using variables.
 
All you'd need is a second timer, that calls itself each second, lowering a variable.
 
Then when you change map, you set a global variable to the timer-variable.
 
When entering a map, it should then set the timer-amount to the new global variable.
			 
 Trying is the first step to success. |  |  
	| 08-31-2014, 02:14 PM |  |  
	
		| DnALANGE  Banned
 
 Posts: 1,549
 Threads: 73
 Joined: Jan 2012
 | 
			| RE: World Timer? 
 
				Iirc..This thing was impossible..
 There were a couple of guys who tried this before.
 Altho, i still think it could be possible with Flawless idea, or let the script capture the time with a variable?
 Let it count and when leaving save that variable and into another map try to make it continue...
 |  |  
	| 08-31-2014, 04:21 PM |  |  
	
		| MrBehemoth   Senior Member
 
 Posts: 408
 Threads: 19
 Joined: Feb 2014
 Reputation: 
40
 | 
			| RE: World Timer? 
 
				It's eminently possible!    
Like FlawlessHappiness was getting at, just use a looping timer. But you can just increment the global variable, like so:
 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 |  |  
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| RE: World Timer? 
 
				Alrighty then. I'll try. Thank you all.
 Double Post! While I have your attention, I got an error.
 
 main (1, 27190): ERR : 'f' is not a member of const double'
 
 weirdly large number
 
 
				
(This post was last modified: 08-31-2014, 05:35 PM by i3670.)
 |  |  
	| 08-31-2014, 05:19 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: World Timer? 
 
				 (08-31-2014, 05:19 PM)i3670 Wrote:  Alrighty then. I'll try. Thank you all.
 Double Post! While I have your attention, I got an error.
 
 main (1, 27190): ERR : 'f' is not a member of const double'
 
 weirdly large number
 
To solve that problem, I think we need to see your script.
 
Since the number is that large I'm gonna guess it's a for-loop problem.
			 
 Trying is the first step to success. |  |  
	| 08-31-2014, 05:46 PM |  |  
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| RE: World Timer? 
 
				Found it, it was a stupid . between a number and an f
			 
 |  |  
	| 08-31-2014, 05:46 PM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: World Timer? 
 
				@MrBehemoth
 Might as well use the AddLocalVarInt instead of SetLocalVarInt with +1 to its current value. Not that it would make a difference, but ya know, that's why it's there.
 
 |  |  
	| 08-31-2014, 07:48 PM |  |  
	
		| MrBehemoth   Senior Member
 
 Posts: 408
 Threads: 19
 Joined: Feb 2014
 Reputation: 
40
 | 
			| RE: World Timer? 
 
				 (08-31-2014, 07:48 PM)Mudbill Wrote:  @MrBehemoth
 Might as well use the AddLocalVarInt instead of SetLocalVarInt with +1 to its current value. Not that it would make a difference, but ya know, that's why it's there.
 
Absolutely, forgot about that one!    
 |  |  
	| 08-31-2014, 09:17 PM |  |  |