Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Excerpt |
---|
This event is triggered once after a saved game is loaded. |
Overview
This event is triggered once, when a saved game is loaded, just prior to the game being resumed.
The primary use of this event is to re-create any data objects that might not have been persisted when the game was saved. For example, if you have objects that you didn't store on the global scope because they contained functions (and functions can't be persisted to a save game) you can recreate them prior to the loaded game resuming.
This event is not to be confused with:
- eventGameInit() – triggered once when a new game is started
- eventStartLevel() – triggered once when a new game is loaded, and also after a new level is loaded due to using loadLevel().
It is recommended that you read Environment Sequences to gain a fuller understanding of this event in context of the initialisation sequence of a loaded game.
Syntax
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventGameLoaded() { // do stuff } |
Parameters
This event has no parameters.
Return value
Warzone does not process your event handler's return value.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function eventGameLoaded() { // don't restart your timers - they were persisted in the save game // and get restarted automatically by the game engine // instead, use this to recreate objects that weren't stored in the save game } |
Div | ||
---|---|---|
| ||
There's no need to restart timers in this event , – they will already be running because they are persisted in save games (that's why you have to specify the function names as strings). |
Div | ||
---|---|---|
| ||
AvailabilityRequires:
|
Div | ||
---|---|---|
| ||
See alsoRelated articles:
|