Skip to content

Add simple 2 game hooks and expose demo globals

Hooks

Mostly to remove all kinds of hacks and ease the experience of managing the game for Lua developer without constant checks.

GameStart

Hook format: addHook("GameStart", functionname)

Function format: function()

Executes whenever internal game's own server starts up. Both in singleplayer and multiplayer. At this point, no map is loaded and no player userdata is handled. This hook is primarily useful for resetting variables and for the I/O library.

GameEnd

Hook format: addHook("GameEnd", functionname)

Function format: function()

Executes whenever game session reached its very ending before credits, any other special screen or before game session quits into titlemap. This hook is useful mostly for evaluating the session.

Globals

Added demo global variables, mainly because there is no way in very customizable cases like Game Styles to NOT break them.

Name Variable type Accessibility
demoplayback boolean Read only
titledemo boolean Read only
demorecording boolean Read only
timingdemo boolean Read only
demosynced boolean Read only
Edited by Skydusk

Merge request reports

Loading