Clone
1
script loading
Bruno Carneiro edited this page 2026-02-13 18:25:50 -03:00
Table of Contents
Script Loading
IScriptRemote and ScriptRemote are used by the game to load the battle and mission scripts. Most mission authors do not implement or call these; they write the Mission class that gets loaded by the game.
IScriptRemote
Kind: interface
Contract for loading battle and mission scripts.
Properties
| Property | Type | Description |
|---|---|---|
IBattle Battle |
IBattle | The current battle instance after loading. |
Methods
| Method | Return | Description |
|---|---|---|
string loadBattleScript(string fileName, IGamePlay gamePlay) |
string | Load the battle script from the given file. If fileName is null, a default ABattle is created. The script must contain a class named Battle that inherits from ABattle. On success returns null; on error returns an error message. |
string loadMissionScript(string fileName, int missionNumber, string sScriptFileName) |
string | Load a mission script from the given file. The script must contain a class named Mission that inherits from AMission. On success returns null; on error returns the exception message. |
ScriptRemote
Kind: class (implements IScriptRemote)
Default implementation of IScriptRemote. Loads the script file, creates instances of Battle and Mission by name, and wires them to the battle.
Usage
Mission script authors need to ensure their script exposes a class named Mission deriving from AMission and (if providing a custom battle) a class named Battle deriving from ABattle.