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
Using a Timer to Unlock a Door
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: Using a Timer to Unlock a Door

asName, afTime, and asFunction are known as arguments.

asName is the name of your timer. Basically a string. It isn't required (unless you wish to use stop timer), but I recommend it as it can help you keep track of multiple timers.

afTime is, well, the time. "Float" is basically a decimal number. As an example, 1.5f will create a timer that runs for 1.5 seconds.

asFunction is the callback. This is the function that will be called when your timer expires.

asTimer is the parameter for the callback function.

Here's an example.

PHP Code: (Select All)
void Function()//Parameters would go here, depending on what called this function
{
    
//This function starts the timer
    
AddTimer("ExampleTimer",1.5f,"TimerCall");
    
//Name of timer, the time, and the callback
}

void TimerCall(string &in asTimer//This function is called when the timer expires
{
   
//Do things here

(This post was last modified: 05-06-2013, 06:00 PM by Tomato Cat.)
05-06-2013, 05:59 PM
Find


Messages In This Thread
Using a Timer to Unlock a Door - by AGP - 05-06-2013, 05:13 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 05:36 PM
RE: Using a Timer to Unlock a Door - by Tomato Cat - 05-06-2013, 05:59 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:13 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:27 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:32 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:49 PM



Users browsing this thread: 3 Guest(s)