Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Mark a mission as finished, either as successful or failed...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
Mission.finish( success );

Parameters

ParameterTypeMandatoryNotesAPI Version
success

Boolean

Constant

(tick)

Defines whether the mission is successful or not.

Specify either a boolean or one of the following constants:

  • Mission.SUCCESSFUL or true – Mission successful
  • Mission.FAILED or false – Mission failed
 1.0

Return value

Does not return anything

Notes

You can also finish a mission by setting the Mission.status parameter to the desired success value.

When the mission finishes, Mission.onFinish() will be triggered.

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
// ways to finish a mission successfully
Mission.finish( Mission.SUCCESSFUL );
Mission.finish( true );
Mission.status = Mission.SUCCESSFUL;
 
// ways to finish a mission as failed
Mission.finish( Mission.FAILED );
Mission.finish( false );
Mission.status = Mission.FAILED;
Div
classbox
Availability
Status
colourRed
titleDev

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

See also

Related articles: