Timers

From Frictional Wiki
< HPL3
Revision as of 15:13, 11 August 2020 by TiMan (talk | contribs)
Jump to navigation Jump to search


Timers are set up to wait for a selected amount of time before executing code. It can be very useful if you want to wait a specified amount of time for something to happen in the level, such as intense countdown or to spawn / despawn particles in a dynamic way.

In order to add timer to a map, we need to use Map_AddTimer

  • explains parameters*

Let’s see an example

  • shows an example*

We can do more than just create a timer, we can remove timers as well, or check if a timer is already running. For example, if we enter this area, create a timer of 5 seconds. However, if a timer has already been created, we don’t need to create that timer again, right? So we can use Map_TimerExists for that.

Timers are very easy to use as you can see, and it will help us to understand the concept of Sequences in the next episode.

See Also