Respawn – Arma 3
mNo edit summary |
mNo edit summary |
||
Line 105: | Line 105: | ||
=== Respawn Templates === | === Respawn Templates === | ||
Default templates in the vanilla game | Default templates in the vanilla game. | ||
==== None ==== | |||
Singleplayer death screen. Default for NONE respawn type and in singleplayer. | |||
==== Spectator ==== | |||
[[Spectator Mode]]. Default for BIRD respawn type. | |||
==== Instant ==== | |||
Currently empty. Default for INSTANT respawn type. | |||
==== Base ==== | |||
Currently empty. Default for BASE respawn type. | |||
==== Group ==== | |||
Cutscene showing a newly controlled unit. Default for GROUP respawn type. | |||
==== Side ==== | |||
Cutscene showing a newly controlled unit. Default for SIDE respawn type. | |||
==== Seagull ==== | |||
OFP-style seagull respawn | |||
==== Wave ==== | |||
Adjusts respawn counter so players spawns together (wave delay is based on ''respawnDelay'') | |||
==== Counter ==== | |||
Show a simple respawn countdown. Default for INSTANT and BASE respawn types. | |||
==== EndMission ==== | |||
Automtically fail the mission once all players are dead. Default for BIRD, GROUP and SIDE respawn types. | |||
==== MenuPosition ==== | |||
[[File:A3 respawnSelectPosition.jpg|200px]] | |||
Let player select from available respawn positions defined either by respawn markers (e.g., ''respawn_west'', see [[#Respawn Types|Respawn Types]]) or by [[BIS_fnc_addRespawnPosition]] function. | |||
Once countdown reaches 0, player is not respawned immediatelly, but must confirm selection by clicking on "RESPAWN" button. | |||
==== MenuInventory ==== | |||
[[File:A3 respawnSelectInventory.jpg|200px]] | |||
Let player pick a respawn loadout defined in CfgRespawnInventory in [[Description.ext]]. | |||
{|class="wikitable collapsible collapsed" | |||
! Example Description.ext | |||
|- | |||
| | |||
class CfgRespawnInventory | |||
{ | |||
class WEST1 | |||
{ | |||
displayName = "Light"; {{codecomment|// Name visible in the menu}} | |||
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; {{codecomment|// Icon displayed next to the name}} | |||
show = "side group _this == west"; {{codecomment|// Condition must return true in order for the loadout to be displayed in the menu. Evaluated when the menu is opened.}} | |||
{{codecomment|// Loadout definition, uses same entries as CfgVehicles classes}} | |||
weapons[] = { | |||
"arifle_MXC_F", | |||
"Binocular" | |||
}; | |||
magazines[] = { | |||
"30Rnd_65x39_caseless_mag", | |||
"30Rnd_65x39_caseless_mag", | |||
"SmokeShell" | |||
}; | |||
items[] = { | |||
"FirstAidKit" | |||
}; | |||
linkedItems[] = { | |||
"V_Chestrig_khk", | |||
"H_Watchcap_blk", | |||
"optic_Aco", | |||
"acc_flashlight", | |||
"ItemMap", | |||
"ItemCompass", | |||
"ItemWatch", | |||
"ItemRadio" | |||
}; | |||
uniformClass = "U_B_CombatUniform_mcam_tshirt"; | |||
backpack = "B_AssaultPack_mcamo"; | |||
}; | |||
class WEST2 | |||
{ | |||
{{codecomment|// Alternative configuration pointing to a CfgVehicles class. Loadout will be copied from it.}} | |||
vehicle = "B_soldier_AR_F" | |||
show = "side group _this == west && score player > 10"; | |||
}; | |||
}; | |||
|} | |||
Once countdown reaches 0, player is not respawned immediatelly, but must confirm selection by clicking on "RESPAWN" button. | |||
=== Scripting Commands === | === Scripting Commands === |
Revision as of 08:59, 23 June 2013
Mission Configuration
Description.ext
A wide range of Description.ext entries lets you to configure respawn settings for your mission.
// Respawn type, see the table below respawn = 2; // Delay in seconds before playable unit respawns. respawnDelay = 10; // Delay in seconds before vehicle respawns. respawnVehicleDelay = 60; // 0 to disable the score table (it can still be opened manually by pressing 'P' key). respawnDialog = 0; // Respawn templates from CfgRespawnTemplates. You can combine any number of them together. respawnTemplates[] = {"Counter","Wave"}; // 1 to execute respawn templates when a player joins the game. Available only for INSTANT and BASE respawn types. respawnOnStart = 1; // When 1, the score table contains score of all playable units as opposed to players only. aikills = 1;
Files
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)
[<unit>,<killer>,<respawn>,<respawnDelay>]
onPlayerRespawn.sqf
- (first 2 params are the same as are passed into Respawn event handler)
[<newUnit>,<oldUnit>,<respawn>,<respawnDelay>]
Parameters:
Respawn Types
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. |
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
Default templates in the vanilla game.
None
Singleplayer death screen. Default for NONE respawn type and in singleplayer.
Spectator
Spectator Mode. Default for BIRD respawn type.
Instant
Currently empty. Default for INSTANT respawn type.
Base
Currently empty. Default for BASE respawn type.
Group
Cutscene showing a newly controlled unit. Default for GROUP respawn type.
Side
Cutscene showing a newly controlled unit. Default for SIDE respawn type.
Seagull
OFP-style seagull respawn
Wave
Adjusts respawn counter so players spawns together (wave delay is based on respawnDelay)
Counter
Show a simple respawn countdown. Default for INSTANT and BASE respawn types.
EndMission
Automtically fail the mission once all players are dead. Default for BIRD, GROUP and SIDE respawn types.
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 immediatelly, but must confirm selection by clicking on "RESPAWN" button.
MenuInventory
Let player pick a respawn loadout defined in CfgRespawnInventory in Description.ext.
Example Description.ext |
---|
class CfgRespawnInventory { class WEST1 { displayName = "Light"; // Name visible in the menu icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name show = "side group _this == west"; // Condition must return true in order for the loadout to be displayed in the menu. Evaluated when the menu is opened. // Loadout definition, uses same entries as CfgVehicles classes weapons[] = { "arifle_MXC_F", "Binocular" }; magazines[] = { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "SmokeShell" }; items[] = { "FirstAidKit" }; linkedItems[] = { "V_Chestrig_khk", "H_Watchcap_blk", "optic_Aco", "acc_flashlight", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio" }; uniformClass = "U_B_CombatUniform_mcam_tshirt"; backpack = "B_AssaultPack_mcamo"; }; class WEST2 { // Alternative configuration pointing to a CfgVehicles class. Loadout will be copied from it. vehicle = "B_soldier_AR_F" show = "side group _this == west && score player > 10"; }; }; |
Once countdown reaches 0, player is not respawned immediatelly, but must confirm selection by clicking on "RESPAWN" button.
Scripting Commands
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 { // Template name displayName = "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; }; class Spectator { displayName = "Spectator"; onPlayerRespawn = "BIS_fnc_respawnSpectator"; }; };