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?
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#9
RE: Can a Constant "Get" Script Run?

If you need it in one map, the following really simple loop will suffice:
const float TIMESTEP = 1.0f / 60.0f;
void OnStart()
{
AddTimer("tmrCheck",TIMESTEP,"cbCheck");
}
void cbCheck(string &in asTimer)
{
// Stuff Here\\
AddTimer(asTimer,TIMESTEP,"cbCheck");
}

Note: OnSaveLoad only exists if you add a timer and routine to check for it (see here if you are interested). This isn't necessary in this case as timers are preserved when the game is saved, and the user cannot save the game in the middle of executing a function. Therefore, in whatever map you want you can really just get away with 1 timer.
(This post was last modified: 11-10-2011, 01:59 AM by Apjjm.)
11-10-2011, 01:57 AM
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 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)