

Care must be taken to ensure that this doesn't happen.

If the script attempts to access or interrogate the game model before it's created then the game will crash.

Being loaded at such an early stage presents some complications, however, as the game model is not initialised until much later in the load sequence. This is to allow scripts to be present while the save file (or startpos file) are loaded - the scripts can save values into the savegame when the game is saved and it is during the loading sequence that these values are read back out. Unlike in battle, campaign scripts begin to load near to the start of the loading sequence.

Object interface for creating scripted cutscenes in campaign.Ī mechanism for stopping progress in the game to allow one bit of script to play through to completion, such as some advice or a scripted tour. Wrapper object provided functionality related to the declaring and management of missions. The main campaign game interface is accessed through this object.Ĭentral campaign object providing functionality specifically related to the user interface. The main script objects related to campaign are listed below:Ĭentral object that provides functionality shared across both campaign and battle, such as ui querying and event listeners.Ĭentral interface object for campaign scripts. Other script objects exist in addition to the campaign manager, documentation for which can be found in the Script Pages list in the navigation bar on the left-hand side of this page. The main script object through which campaign calls are made is the campaign_manager.Ī campaign_manager object is created automatically when the script libraries are loaded in, but a name for the campaign must be set at an early stage with campaign_manager:set_campaign_name. The campaign script libraries are built on top of the raw interface provided by campaign to script and offer extensive support and extended functionality for campaign scripting.
