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:

(warning) 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
themeEclipse
languagejavascript
linenumberstrue
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
themeRDark
languagejavascript
linenumberstrue
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
classbox notice ping

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
classbox

Availability

Requires:

  • Warzone 3.2 and above.
Div
classbox

See also

Related articles: