Respawn – Arma 3
(Reference to Revive respawn template removed as the Revive is not anymore controlled by respawn templates. Check the mission attributes settings.) |
|||
Line 3: | Line 3: | ||
== Mission Configuration == | == Mission Configuration == | ||
=== Description.ext === | === Description.ext === | ||
A wide range of [[Description.ext]] entries lets you to configure respawn settings for your mission. | A wide range of [[Description.ext]] entries lets you to configure respawn settings for your mission. See [https://community.bistudio.com/wiki/Description.ext#Respawn.2FRevive Description.ext - Respawn] for a detailed documentation | ||
=== Files === | === Files === | ||
Line 28: | Line 12: | ||
'''onPlayerKilled.sqf'''<br /> | '''onPlayerKilled.sqf'''<br /> | ||
:''(first 2 params are the same as are passed into [[Arma_3:_Event_Handlers#Killed|Killed]] event handler)'' | :''(first 2 params are the same as are passed into [[Arma_3:_Event_Handlers#Killed|Killed]] event handler)'' | ||
:<code>[ | :<code>[[params]] ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];</code> | ||
'''onPlayerRespawn.sqf'''<br /> | '''onPlayerRespawn.sqf'''<br /> | ||
:''(first 2 params are the same as are passed into [[Arma_3:_Event_Handlers#Respawn|Respawn]] event handler)'' | :''(first 2 params are the same as are passed into [[Arma_3:_Event_Handlers#Respawn|Respawn]] event handler)'' | ||
:<code>[ | :<code>[[params]] ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"];</code> | ||
'''Parameters:''' | '''Parameters:''' |
Revision as of 15:43, 17 June 2018
Mission Configuration
Description.ext
A wide range of Description.ext entries lets you to configure respawn settings for your mission. See Description.ext - Respawn for a detailed documentation
Files
When you create files called onPlayerKilled.sqf and onPlayerRespawn.sqf in your mission directory, they will be automatically executed on player's computer when he dies and respawns.
Following parameters are passed into it in both cases:
onPlayerKilled.sqf
- (first 2 params are the same as are passed into Killed event handler)
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
onPlayerRespawn.sqf
- (first 2 params are the same as are passed into Respawn event handler)
params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"];
Parameters:
Respawn Types
Type is represented either by respawn ID
respawn = 3;
Or by its name
respawn = "BASE";
ID | Name | Description | onPlayerKilled | onPlayerRespawn |
---|---|---|---|---|
0 | "NONE" | Show singleplayer death screen | Template:task/ | Template:task |
1 | "BIRD" | Respawn to a seagull | Template:task | Template:task/ |
2 | "INSTANT" | Respawn on spot where player died | Template:task/ | Template:task/ |
3 | "BASE" | Respawn on a marker(s) start by following strings:
You can have multiple markers simply by adding any text behind the name, e.g. respawn_west1, respawn_westBase etc. When no markers are defined, player is respawned on position where he started the mission. More about marker respawn can be found here |
Template:task/ | Template:task/ |
4 | "GROUP" | Respawn to the next available playable unit in a group. When none is left, BIRD respawn is used instead. | Template:task | Template:task/ |
5 | "SIDE" | Respawn to the next available playable unit of the same side (selected using team switch window). When none is left, BIRD respawn is used instead. | Template:task | Template:task/ |
Respawn Templates
Templates are pre-defined scripts called when player dies and respawns. They are defined in an array and can be combined together.
respawnTemplates[] = {"MenuInventory","MenuPosition"};
Additionally, you can define side specific templates. When a side has no unique templates, it will use general respawnTemplates instead.
respawnTemplatesWest[] = {"MenuInventory"};
respawnTemplatesEast[] = {"Counter"};
respawnTemplatesGuer[] = {"Tickets"};
respawnTemplatesCiv[] = {"Spectator"};
respawnTemplatesVirtual[] = {}; // Virtual players, used mainly in Curator missions
When the respawnTemplates entry is missing, default templates based on the respawn type are used:
- NONE: None
- BIRD: Spectator, EndMission
- INSTANT: Instant, Counter
- BASE: Base, Counter
- GROUP: Group, EndMission
- SIDE: Side, EndMission
A list of official templates follows:
Class | Description | Preview | ||
---|---|---|---|---|
None | Singleplayer death screen. Default in singleplayer. | |||
Spectator | Spectator Mode. | |||
Instant | Currently empty. | |||
Base | Currently empty. | |||
Group | Cutscene showing a newly controlled unit. | |||
Side | Cutscene showing a newly controlled unit. | |||
Seagull | OFP-style seagull respawn | |||
Wave | Adjusts respawn counter so players spawns together (wave delay is based on respawnDelay) | |||
Tickets | Use a limited respawn ticket pool for players. Pool can be applied to everyone, a side, a group or a single unit.
Use BIS_fnc_respawnTickets to update the amount of available tickets. Note that the template will have no effect if this function is never used, meaning players outside of all given pools will have infinite respawns. |
|||
Counter | Show a simple respawn countdown. | |||
EndMission | Automatically fail the mission once all players are dead (for NONE, BIRD, GROUP and SIDE respawn types) or when all respawn tickets are exceeded (for INSTANT and BASE respawn types with Tickets template) | |||
MenuPosition | Let player select from available respawn positions defined either by respawn markers (e.g., respawn_west, see Respawn Types) or by BIS_fnc_addRespawnPosition function.
Once countdown reaches 0, player is not respawned immediately, but must confirm selection by clicking on "RESPAWN" button. |
|||
MenuInventory | Let player pick a respawn loadout defined in CfgRespawnInventory in Description.ext. Loadouts can be added using BIS_fnc_addRespawnInventory function.
Once countdown reaches 0, player is not respawned immediately, but must confirm selection by clicking on "RESPAWN" button. |
|
Respawn Button
Respawn button in the pause menu is automatically now enabled for INSTANT, BASE, GROUP and SIDE respawn types. You can set its availability manually using following description.ext entry:
respawnButton = 0;
- 1 - enabled
- 0 - disabled
Scripting Commands
Scripting Functions
System Configuration
Respawn Templates
New templates can be defined in global Config.cpp or in mission and campaign Description.ext files.
class CfgRespawnTemplates { // Class used in respawnTemplates entry class myTag_beacon { // Function or script executed upon death. Parameters passed into it are the same as are passed into onPlayerKilled.sqf file onPlayerKilled = "\myAddon\scripts\respawnBeacon.sqf"; // Function or script executed upon respawn. Parameters passed into it are the same as are passed into onPlayerRespawn.sqf file onPlayerRespawn = "\myAddon\scripts\respawnBeacon.sqf"; // Default respawn delay (can be overwitten by description.ext entry of the same name) respawnDelay = 20; // 1 to respawn player when he joins the game. Available only for INSTANT and BASE respawn types // Can be overridden by description.ext attribute of the same name respawnOnStart = 1; }; class Spectator { onPlayerRespawn = "BIS_fnc_respawnSpectator"; }; };