This AI is still in early stages of development.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

API for managing missions and their objectives.

 

properties

 

Mission

.name – name of mission (string)

.date – date on which the mission starts (date object)

.id – mission id (string)

.status – true = mission successful, false = mission failed, undefined/null = in progress (default: undefined)

.timeLimit – get/set time limit, null = no time limit

.onTimeout() – triggered when mission timer runs out

.onSuccess() – triggered when mission successful

.onFailure() – triggered when mission failed

.objective(obj) – add an objective

.progress – number of mandatory objectives completed

.objectives[]

.<number> = objectiveIDs

.<objectiveID> = objective object

.id – string

.title – string

.status – true = objective achieved, false = objective failed, undefined/null = in progress (default)

.tasks – total number of tasks

.progress – number of tasks completed

.inc([data]) – increment progress, optionally pass in data for event handler

.optional – objective optional? true/false (default: false)

.hidden – objective hidden? true/false (default: false)

.enabled – objective enabled? true/false (default: true)

.requires – array of prerequisite objectives

.enables – array of objectives to enable when on success

.onProgress() – triggered when done changes

.onCompleted() – triggered when the objective is completed

.onFailed() – triggered when the objective is failed

.onEnabled() – triggered when the objective is enabled

.onDisabled() – triggered when the objective is disabled

  • No labels