Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
This event is triggered once at the start of the game before the map is ready. |
Overview
This event is only called when a game first starts, it is not called when a saved game is loaded.
When the event is fired, all your scripts have been loaded and basic game initialisation is complete:
- You can retrieve basic information about the game, such as playerData and use most if not all of the enum functions (such as enumDroid() and enumStruct())
- Do not issue any commands (such as production, research or droid orders) because the game hasn't properly started yet.
- Avoid setTimer(), queue() or bind() calls linked to functions that issue commands, because they might get triggered before the game properly starts.
To issue initial commands or set timers, etc., it's much safer to use eventStartLevel() instead.
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventGameInit() { // do stuff } |
Parameters
This event has no parameters.
Return value
Warzone does not process your event handler's return value.
Example
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
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; } } } |
Div | ||
---|---|---|
| ||
AvailabilityRequires:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|