02: Persistence & Respawn General Guide - 14aag/mission_template GitHub Wiki

PERSISTENCE & RESPAWN

There are a few things of note when it comes to the respawn and persistence systems we have running in our operations. Especially when it comes to the setup and usage. Underneath you’ll find both the description file setup and the various options you have in 3DEN and Zeus.

Respawn Bags

We work with respawn bags, each bag has a set number of tickets (see below for setup) and can be placed where you want it as the leader of your group in Arma.

Description file setup

In the description file you’ll find a few lines of settings that you can change depending on the settings you want to use. Firstly of note is the following lines:

respawn = 3;  
respawnDelay = 5;
respawnVehicleDelay = 30;
respawnTemplates[] = {"Base"};
respawnOnStart = 0;

These correspond with the actual ARMA settings for respawns. You can check the Arma Wiki for most of what the settings mean. Keep these if you don’t directly understand what they mean and what they do.

Then for the persistence scripts that are running. All the lines that start with efn_persistence have to do with our persistence and respawn systems. To start:

efn_persistence_savePlayerLoadout = 1;
efn_persistence_savePlayerPosition = 1;
efn_persistence_serverRestart = 1;
efn_persistence_excludeZeus = 0;

These lines are about player inventory (Loadout) and Map position. Leave them alone for the most part as they are the thing that prevents players from respawning back at the starting area when they have disconnects or crashes and instead puts them back near their teams when they reconnect to the server. The exludezeus excludes persistence things placed during a mission by Zeus if 0 is changed to 1.

efn_respawn_enabled = 1;
efn_respawn_ticketCount = 12;
efn_respawn_timer = 175;
efn_respawn_minDistance = 0;

efn_respawn_tentCooldown = 0;
efn_respawn_outOfTicketsRemove = 1;

These lines correspond with the respawn system that is in place. You are recommended to change these to fit your needs on a mission to mission basis. These are the default settings that will suit most fun ops as well as other side operations not held on the main operation days.

efn_respawn_enabled = 1; Handles if the respawn bags are on or not. 1 for on, 0 for off.
efn_respawn_ticketCount = 12; Handles the amount of tickets until the bag is empty of respawns.
efn_respawn_timer = 175; Handles the amount of time that players are in observer cam.
efn_respawn_minDistance = 0; Handles the distance a team leader can replace the bag from another active bag. Regardless of tickets that still remain. Larger amounts means more thinking to be done where it is placed. Also ties into efn_respawn_outOfTicketsRemove.

efn_respawn_tentCooldown = 0; Handles the cooldown to be able to replace the bag once tickets run out.
efn_respawn_outOfTicketsRemove = 1; Handles if the bag is removed after tickets run out. 1 means that the bag disappears once it runs out of tickets, free to be placed again. 0 means that the bag will remain in its location after tickets runout and efn_respawn_minDistance is used to determine if you can place the bag again or not.

!General persistence warning!

If you do not assign a variable name to vehicles or crates placed down in the editor. Arma will assign a dynamic name to them upon mission load and that gets saved into persistence. This can cause unwanted behavior due to this name changing when you remove other non-variable vehicles. The main behavior observed is duplication and all the results that that might have. Examples are the vehicle located where you left it as well as where you spawned it or vehicles spawning inside of existing vehicles.

The rules are:

  • Give all your vehicles and crates a variable name to avoid unwanted behavior.
  • End of mission use 14AAG Persistence Zeus module: ‘Save current state’.
  • What is on the field upon use of the module will be there next session.

Crate persistence

The persistence script has the ability to have crates be persistent. This is in terms of location and contents. Standard camp layout should include some sort of crate the guys can use to dump spare gear and return to, even potentially recover from enemy hands.

To set it up add a Variable name in 3DEN to the crate and that is all. If you remove a crate during a mission in Zeus, it’ll appear next time on it’s original spawn spot unless you update it’s location in 3DEN in between missions.

Crates (and vehicles) spawned via Crate Filler and Zeus are also persistent. Observe the General Persistence warning and rules for behavior.

Vehicle persistence

Make sure to -NOT- name them vehicle_xxx with xxx being numbers or letters. Specifically the word ‘vehicle’ is the standard variable name ARMA gives them and will cause conflicts.

Same setup as for Crates for the rest, remove in mission = respawn next time you load the map on original location. Inventory, damage state and location are saved. ACE Storage is -NOT- so players must unload their cargo first before they log off.

If you do not want the vehicle to be persistent. Then add the following line to the Init field in 3DEN: this setVariable ["efn_persistence_excluded", true];

Player persistence

Player persistence is very easy to manage from an editor and Zeus perspective. See the below 2 subjects that tie directly into it and the respawn system for most of the finer details. Upon player logoff or disconnection the players location is saved as well as it’s complete inventory. This is done on a 2D plane. If the player disconnects while in a helicopter or other vehicle the player will respawn back at the original spawn location.

As a backup to the automatic save state there is a manual module in Zeus for it as well, reference the warning and rules. Incase the built in one breaks for #Arma reasons.

RESPAWN Automatic assignment in EDEN.

In EDEN you can add to the group INIT the following code to have the group leader automatically receive the option to place down respawns on mission start.

this setVariable ["leader_name", "some_unique_name"];
A thing to note is that the only change you need to make is to the “some_unique_name” to match your fireteam or unit group name in question.

Enable and Disable Respawn tents in ZEUS.

Works on training map and ‘should’ work during normal campaigns. You can do this by finding the Execute Code module under Development Tools. Set it to Local.

Disable respawn tent: ["efn_respawn_set_mode", 0] call CBA_fnc_globalEvent
Enable respawn tent: ["efn_respawn_set_mode", 1] call CBA_fnc_globalEvent
Zeus controlled respawn: ["efn_respawn_set_mode", 2] call CBA_fnc_globalEvent