Scenario scripts can control a general mission sequence or define specific features such as rejoins or special player placement. For documentation of the scripting language see
C4Script.
The following callbacks are made to the scenario script. All callbacks except
Initialize
that are made to scenario script from the engine are also made to all goals, rules and environment objects in the game. Other scripts can access local variables of the scenario and call scenario functions with the global proplist
Scenario
. With the functions
GameCall and
GameCallEx, callbacks to the scenario script can be made from scripts.
At the start of each round, before the players have joined, the engine calls the function "Initialize" in the scenario script, if defined. Within this function a scenario can perform special object placement or start the scenario scripting sequence.
After joining a new player the engine calls the function InitializePlayer in the scenario script for that player. This function is called after the basic player objects as defined in Scenario.txt have been placed, so a preliminary starting position has been selected and the player's crew and starting material and buildings are present. In this function, you can now perform more special initial placement.