Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:2.00

Description

Description:Executes a scripted mission, either from the main menu, or from inside another mission.

This allows the instant execution of a mission using a button in the main menu, or the linking of several separate missions, which could possibly branch in different directions, depending on the mission outcome.

A "scripted mission" is one where everything is created using a script (the player, as well as any other required units, vehicles, or objects).

This script has to reside somewhere already (most likely in an addon), and is called by this command to populate the initially empty mission. A configuration file can be specified, in case mission-specific dialogs would like to be used (performing the function of description.ext, which would be used in a normal mission).

If the command is executed from inside a mission (with the fromMission parameter set to true), nothing happens, until the user has exited into the main menu. In order to automate the mission jump, the forceEnd command can be used from a script, but the user still sees, and has to confirm, the debriefing dialog.

Note: Be aware that, if the user presses the Retry button, while in a scripted mission, they end up in an empty mission, unable to move.

Syntax

Syntax:playScriptedMission [world, script, config, fromMission]
Parameters:
  • world: String - Configuration name of terrain to use (for example, "Intro" for Rahmadi). Can be found using worldName.
  • script: Code - Script to execute, once terrain loads. This script has to populate the mission with the player, and so on.
  • config: Config-2 - Configuration to use for dialogs, and so on (can be missionConfigFile).
  • fromMission: Boolean - Must be true, if the command is executed from within a mission; to load the specified script, once the user is in the main menu.
Return Value:Nothing

Examples

Examples:
playScriptedMission ["intro",{execVM "\myAddon\missions\init1.sqf"},missionConfigFile,true]
Demo mission that allows the player to jump between three different missions, using radio calls: playScriptedMission.zip

Additional Information

See also: hostScriptedMission, hostMission, playMission
Multiplayer: 
Problems: 

Notes