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
Can a Constant "Get" Script Run?
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#7
RE: Can a Constant "Get" Script Run?

(11-09-2011, 02:54 AM)Your Computer Wrote: ...your only chance for a "global" timer may be through global.hps...
I've actually tried writing out void functions in the global.hps script but they're not responsive, at least when I tried called them using local scripts. I haven't dug deep into that though, so I may be wrong. But the best way I can think of creating a "global" timer would be using global vars.

global.hps
PHP Code: (Select All)
void OnGameStart()
{    
// how much time is left on the timer?    
    
SetGlobalVarInt("TIMERTIME"100);    
    
// the duration of the global timer -- this value doesn't change
    
SetGlobalVarInt("GLOBALTIMERdur"100);


map1.hps & map2.hps & map3.hps etc...
PHP Code: (Select All)
// may have to add a looping timer to constantly save the time left, just in case the player saves and exits the game, which does NOT count as OnLeave

void OnEnter()
{
    
AddTimer("GLOBALTIMER"GetGlobalVarInt("TIMERTIME"), "CATASTROPHE");
}
void OnSaveLoad() // not sure if this even works, but it exists according to Apjjm! :D
{
    
AddTimer("GLOBALTIMER"GetGlobalVarInt("TIMERTIME"), "CATASTROPHE");
}
void OnLeave()
{
    
SetGlobalVarInt("TIMERTIME"GetTimerTimeLeft("GLOBALTIMER"));
    
RemoveTimer("GLOBALTIMER");


(This post was last modified: 11-09-2011, 07:23 PM by palistov.)
11-09-2011, 07:22 PM
Find


Messages In This Thread
Can a Constant "Get" Script Run? - by Statyk - 11-09-2011, 12:37 AM
RE: Can a Constant "Get" Script Run? - by Statyk - 11-09-2011, 02:00 AM
RE: Can a Constant "Get" Script Run? - by palistov - 11-09-2011, 07:22 PM
RE: Can a Constant "Get" Script Run? - by Statyk - 11-09-2011, 09:52 PM
RE: Can a Constant "Get" Script Run? - by Apjjm - 11-10-2011, 01:57 AM
RE: Can a Constant "Get" Script Run? - by Statyk - 11-10-2011, 08:01 PM



Users browsing this thread: 1 Guest(s)