This AI is still in early stages of development.
Mission
The global Mission namespace contains all properties, methods and events relating to the current mission...
Properties
Getting and setting mission properties...
var value = Mission.<property>;
Mission.<property> = value;Note: A mission cannot start until all mandatory properties are specified.
Property | Type | Mandatory | Persists | Notes | API Version |
|---|---|---|---|---|---|
id | String | The mission ID, for example "cam1a" | 1.0 | ||
name | String | The mission name (title), for example "Scavenger Uprising" | 1.0 | ||
date | Date | The mission start date and time. Tip: You can use month constants to make code more readable. | 1.0 | ||
labels | Array of String | An array of labels that the mission requires. Each label will be checked to ensure it exists in labels.ini and an error thrown if the label is missing. | 1.0 | ||
status | Constant | The current status of the mission:
You can set the status directly by setting an appropriate value, or by using the Mission.finish() method. When the mission is won or lost, Mission.onFinish() is triggered. | 1.0 | ||
timeLimit | Number Boolean | Optionally specify a time limit for the mission, in seconds. When set to a positive number, the mission timer will be displayed and the countdown will start. Tip: You can use SECS and MINS constants to make code more readable. When the countdown reaches Set to Default: | 1.0 | ||
countdown | Countdown Notification Scheme | Notifications for the Mission.timeLimit countdown. Tip: Several ready-made notification schemes are available – see "Constants" section below for more information. Default: | 1.0 | ||
timeReinforce | Number Boolean | Optionally specify a reinforcements timer, in seconds. When set to a positive number, the reinforcements timer will be displayed and the countdown will start. Tip: You can use SECS and MINS constants to make code more readable. When the countdown reaches Set to Default: | 1.0 | ||
transport | Countdown Notification Scheme | Notifications for the Mission.timeReinforce countdown. Tip: Several ready-made notification schemes are available – see "Constants" section below for more information. Default: | 1.0 | ||
objectives | List of Objectives |
| A list of objects defined for the mission. Most data relating to objectives is persisted. See Mission.objectives for more information. | 1.0 | |
progress | Number |
| The percentage of mandatory objectives that have been completed. Range: 0 → 100 If no objectives are defined, defaults to 100. | 1.0 |
Methods
Calling methods...
var returnValue = Mission.<method>( <parameters> );Method | Notes | API Version |
|---|---|---|
objective(obj) | Adds a new mission objective to the Mission.objectives list. See Mission.objective() and Mission.objectives for more information. | 1.0 |
start() | Start the mission. Will throw an error if mandatory Mission properties are not defined. See Mission.start() for more information. | 1.0 |
finish(success) | Finish the mission. Note: You can also finish a mission by setting Mission.status to an appropriate value. See Mission.finish() for more information. | 1.0 |