Difference between revisions of "HPL3/Scripting/Scripting Guide/Timers"

From Frictional Wiki
Jump to navigation Jump to search
(Created page with "{{wip}} {{Hpl3ScriptingGuideMenuBasic}} {{shortPageTitle}} Timers are set up to wait for a selected amount of time before executing code. It can be very useful if you want to...")
 
Line 20: Line 20:
 
* [[HPL3/Scripting/Map Helper|Map Helper]]
 
* [[HPL3/Scripting/Map Helper|Map Helper]]
  
{{NavBar|HPL3/Scripting/The Update method|The Update method|HPL3/Scripting/HPL3 Scripting Guide|HPL3 Scripting Guide|HPL3/Scripting/Timers|Timers}}
+
{{NavBar|HPL3/Scripting/Trigger Areas|Trigger Areas|HPL3/Scripting/HPL3 Scripting Guide|HPL3 Scripting Guide|HPL3/Scripting/Sequences|Sequences}}
  
 
[[Category:HPL3 Scripting]]
 
[[Category:HPL3 Scripting]]
 
[[Category:English]]
 
[[Category:English]]

Revision as of 15:13, 11 August 2020


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