Event functions
Event functions are functions sharing the same name. It can be defined multiple times but only once per file. Such functions are useful for implementing callback type functions. Every time an event is called, all instances of the same name will be called. The event is func
with a return type event
. Events are defined globally, meaning they ignore namespace they are in. To call an event from a script, use the external function Hlp_DoEvent(var string funcName)
.
Plugin implements two of these event functions
func event GameInit()
- called when entering the main menu on game startfunc event GameLoop()
- called every frame when a world is loaded
Define these in any file in your scripts, they will be automatically called