Overview
This event is triggered once at the start of the game before the map is ready.You can use it to initialise your scripts but don't try interacting with the map or any game objects at this point as they won't be ready.
Availability
Warzone 3.1 Beta 1 and above.
Syntax
function eventGameInit() { // do stuff }
Parameters
This event has no parameters.
Return value
Warzone does not process your event handler's return value.
Example
Choose a research path based on AI difficulty
var insaneResearchPath = [ /* research items here */ ]; var hardResearchPath = [ /* research items here */ ]; var mediumResearchPath = [ /* research items here */ ]; var easyResearchPath = [ /* research items here */ ]; function eventGameInit() { switch (difficulty) { case INSANE: { global.researchPath = insaneResearchPath; break; } case HARD: { global.researchPath = hardResearchPath; break; } case MEDIUM: { global.researchPath = mediumResearchPath; break; } case EASY: { global.researchPath = easyResearchPath; break; } } }
See also
- eventStartLevel() – triggered once the map has been initialised