Arma 3 Scripting

BIS_fnc_respawnManager

  • Arma 3 v0.50
  • First in Arma 2: Operation Arrowhead v1.50

Function · Markdown · JSON · original wiki page

Description

Respawn manager with checkpoints. Checkpoints are markers named "BIS_checkpointnr1", "BIS_checkpointnr2", ... (numbered without gaps); at least one must exist when the manager is initialised. "Init" creates the global logic BIS_RespawnManager that holds the manager's data and adds "Killed" and "Respawn" event handlers to the given units:

Every mode except "Init" returns false while the manager is not initialised. The function is meant to be called by mission scripts; no Arma 3 script calls it.

Important

  • This is legacy Arma 2 code: the event handlers are added through the Arma 2 Multiplayer Framework function RE, which is not part of Arma 3's Functions Library.
  • Parameters are passed on by format and compile: units must therefore have a variable name.

Syntax

Syntax 1

["Init", [respawners, safePositions], markerVisibility] call BIS_fnc_respawnManager

Parameters:

Returns: Boolean - false if the manager was already initialised, otherwise true

Syntax 2

["Destroy"] call BIS_fnc_respawnManager

Parameters:

Returns: Boolean - true

Syntax 3

["AddCheckpoint", position, markerName] call BIS_fnc_respawnManager

Parameters:

Returns: Boolean - true

Syntax 4

["RemoveCheckpoint", markerName] call BIS_fnc_respawnManager

Parameters:

Returns: Boolean - true if removed, false if the marker is not a checkpoint or it is the last one

Syntax 5

["GetNearestCheckpoint", unit] call BIS_fnc_respawnManager

Parameters:

Returns: String - marker name of the checkpoint stored for the unit, or the first checkpoint if none is stored

Examples

Example 1

// markers "BIS_checkpointnr1", "BIS_checkpointnr2" are placed in the mission
["Init", [[BIS_player1, BIS_player2], []]] call BIS_fnc_respawnManager;
["AddCheckpoint", getMarkerPos "BIS_village", "BIS_checkpointVillage"] call BIS_fnc_respawnManager;
["RemoveCheckpoint", "BIS_checkpointnr1"] call BIS_fnc_respawnManager;

See also

Arma 3: Respawn · BIS_fnc_addRespawnPosition · BIS_fnc_findSafePos