---
name: "playScriptedMission"
type: command
status: ok
groups: ["System"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/playScriptedMission
revid: 369272
updated: 2024-09-03T18:42:43Z
---

# playScriptedMission

*Command · System · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Load the given world, launch an empty mission, and execute the given expression.
If provided, *config* can reference to the config entry, replacing [Description.ext](../topics/Description.ext.md) for this mission.

## Syntax

```sqf
playScriptedMission [world, expression, config, ignoreChildWindow]
```

**Parameters:**

- `world`: [String](../topics/String.md)
- `expression`: [Code](../topics/Code.md)
- `config`: [Config](../topics/Config.md) - (Optional)
- `ignoreChildWindow`: [Boolean](../topics/Boolean.md) - (Optional)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
playScriptedMission
[
    "desert_e",
    {
        execVM "\ca\missions_e\data\scenes\credits1\init.sqf";
    },
    configFile / "CfgMissions" / "Cutscenes" / "Credits"
];
```

## See also

[hostMission](../commands/hostMission.md) · [playMission](../commands/playMission.md) · [createMissionDisplay](../commands/createMissionDisplay.md) · [createMPCampaignDisplay](../commands/createMPCampaignDisplay.md)

## Community notes

**SkaceKachna** — 2015-12-31

For this command to work, you will need to:
1. call command with ignoreChildWindow param set to true (in VBS docs its called fromMission)
1. close any opened display (not sure about this part, but closing every display (but #0) seems to work):
  - if mission is run from 2D editor, you can just close RscDisplayArcadeMap display (idd 26) (because this was done from 2D editor, so RscDisplayArcadeMap is still active in background -- benargee)
  - if mission is run from single mission browser, you can just close RscDisplaySingleMission (idd 2)
1. end mission

Debriefing will show and player will be moved to new mission after clicking on Continue.

Command is a bit bugged:
- third (config) param doesn't seem to work
- if you run this command in mission loaded from pbo, said pbo won't be writable until you close the game (you can't update it)

Following code will change change island to Stratis and spawns player as basic soldier at [0,0,0] coordinates.

```sqf
disableSerialization;
playScriptedMission ['Stratis', {
    private _grp = createGroup west;
    private _player = _grp createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
    selectPlayer _player;
}, missionConfigFile, true];

// Close all displays that could be the background display ... this is essentially forceEnd command
// Closing #0 will cause game to fail
_zero = findDisplay 0;
{
    if (_x != _zero) then {
        _x closeDisplay 1;
    };
} foreach allDisplays;
failMission "END1";
```

(tested in Arma 3 1.54.133741)

<sub>Source: [BI Community Wiki — playScriptedMission](https://community.bistudio.com/wiki/playScriptedMission) (revision 369272).</sub>
