{"name":"BIS_fnc_EXP_camp_manager","title":"BIS fnc EXP camp manager","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_manager","revid":379564,"updated":"2026-10-31T13:54:37Z","groups":["CampaignManager"],"status":"ok","games":{"arma3":"1.62"},"since":"arma3 1.62","arma3_since":"1.62","exec":"spawn","description":"Synchronises the start of an Apex campaign mission between the server and the clients by moving the mission through the states `\"Waiting\"`, `\"Intro\"`, `\"Loadout\"` and `\"Started\"`. Each state change fires a scripted event (see BIS_fnc_EXP_camp_manager_triggerEvent).\nThe function is spawned on every machine by the campaign's shared init script (`\\A3\\Missions_F_Exp\\Campaign\\Scripts\\init.sqf`, included by each mission's `init.sqf`), after the handlers for these events have been added. It is meant for internal use by the campaign.\n\nOn every machine, it stores the intro videos, their subtitle scripts and the *noCinematics* flag in missionNamespace.\n\nOn a machine with a player (hasInterface), it waits for player, fires the `\"Waiting\"` event locally, adds a public variable event handler that fires the event of every new state received from the server, and adds a \"Respawn\" event handler that deletes the player's old body (once).\n\nOn the server, after the mission time has started:\n\n1. setTimeMultiplier is set to 0.1 so the synchronisation does not move the time of day.\n1. It waits until every player has registered as preloaded (see BIS_fnc_EXP_camp_manager_onPlayerRegistered) or until mission time reaches *maxWaitDelay*, then waits *minWaitDelay* seconds.\n1. In multiplayer, if intro videos are given, it sets the state `\"Intro\"`.\n1. In multiplayer, if *wantsLoadoutSelection* is true, it sets the state `\"Loadout\"`, waits until every player has registered a finished loadout selection or *maxLoadoutDelay* seconds have passed, forces respawn on all machines (`0 remoteExecCall [\"setPlayerRespawnTime\", 0]`) and waits *minLoadoutDelay* seconds.\n1. It sets the state `\"Started\"` and restores the previous time multiplier.\n\nIn single-player the mission goes directly from `\"Waiting\"` to `\"Started\"`.","syntaxes":[{"syntax":"[introVideos, introVideosSubtitles, minWaitDelay, minLoadoutDelay, maxWaitDelay, maxLoadoutDelay, wantsLoadoutSelection, noCinematics] spawn BIS_fnc_EXP_camp_manager","params":[{"name":"introVideos","type":"Array of Strings","optional":true,"default":"[]","description":"paths of the intro videos to play in order; an empty array skips the intro","type_expr":"Array<String>","text":"introVideos: Array of Strings - (Optional, default []) paths of the intro videos to play in order; an empty array skips the intro"},{"name":"introVideosSubtitles","type":"Array of Strings","optional":true,"default":"[]","description":"for each intro video, the path of a subtitle script run with execVM, or \"\" for none","type_expr":"Array<String>","text":"introVideosSubtitles: Array of Strings - (Optional, default []) for each intro video, the path of a subtitle script run with execVM, or \"\" for none"},{"name":"minWaitDelay","type":"Number","optional":true,"default":"2","description":"seconds to wait after all players have preloaded","type_expr":"Number","text":"minWaitDelay: Number - (Optional, default 2) seconds to wait after all players have preloaded"},{"name":"minLoadoutDelay","type":"Number","optional":true,"default":"2","description":"seconds to wait after the loadout selection has ended","type_expr":"Number","text":"minLoadoutDelay: Number - (Optional, default 2) seconds to wait after the loadout selection has ended"},{"name":"maxWaitDelay","type":"Number","optional":true,"default":"30","description":"mission time in seconds after which the server stops waiting for players to preload","type_expr":"Number","text":"maxWaitDelay: Number - (Optional, default 30) mission time in seconds after which the server stops waiting for players to preload"},{"name":"maxLoadoutDelay","type":"Number","optional":true,"default":"300","description":"maximum time in seconds to wait for all players to finish the loadout selection","type_expr":"Number","text":"maxLoadoutDelay: Number - (Optional, default 300) maximum time in seconds to wait for all players to finish the loadout selection"},{"name":"wantsLoadoutSelection","type":"Boolean","optional":true,"default":"true","description":"false to skip the loadout selection","type_expr":"Boolean","text":"wantsLoadoutSelection: Boolean - (Optional, default true) false to skip the loadout selection"},{"name":"noCinematics","type":"Boolean","optional":true,"default":"false","description":"true to disable BIS_fnc_EXP_camp_setCinematicMode; cinematics must then be handled manually","type_expr":"Boolean","text":"noCinematics: Boolean - (Optional, default false) true to disable BIS_fnc_EXP_camp_setCinematicMode; cinematics must then be handled manually"}],"returns":{"type":"Nothing","type_expr":"Nothing"}}],"examples":[{"text":"As in the Apex campaign mission EXP_m02:\n\n```sqf\n[\n    [\"A3\\Missions_F_Exp\\video\\EXP_m02_vTitlecard.ogv\", \"A3\\Missions_F_Exp\\video\\EXP_m02_vIN.ogv\"],\n    [\"\", \"a3\\Missions_F_Exp\\Campaign\\Briefings\\EXP_m02_briefing.sqf\"],\n    nil, nil, nil, nil,\n    true,\n    false\n] spawn BIS_fnc_EXP_camp_manager;\n```","code":["[\n\t[\"A3\\Missions_F_Exp\\video\\EXP_m02_vTitlecard.ogv\", \"A3\\Missions_F_Exp\\video\\EXP_m02_vIN.ogv\"],\n\t[\"\", \"a3\\Missions_F_Exp\\Campaign\\Briefings\\EXP_m02_briefing.sqf\"],\n\tnil, nil, nil, nil,\n\ttrue,\n\tfalse\n] spawn BIS_fnc_EXP_camp_manager;"]}],"see_also":["BIS_fnc_EXP_camp_manager_getState","BIS_fnc_EXP_camp_manager_setState","BIS_fnc_EXP_camp_manager_triggerEvent","BIS_fnc_EXP_camp_manager_onPlayerRegistered","BIS_fnc_addScriptedEventHandler"]}