Norrin's Revive Script (Configurable)

By norrin

Configuring revive_init.sqf

The main configuration of the revive scripts is contained within the revive_init.sqf. If you have installed everything correctly this should be the only file you need to make tweaks to. This  file is broken down into sections, you should review all sections and make your desired changes. It may take some time to tweak the options you like best and before you plunk this into your 5 star mission you should experiment with a smaller mission. Don't let the shear number of sections and options deter you. For the most part the default options will work for you.

Section A

The first section of the revive_init.sqf allows configuration of the main revive script options, you can toggle these options on and off with a "=1" and off with a "=0".

mission_end_function - ends the mission when all player units are unconscious. If implemented creates a trigger using the triggerType "END6".

all_dead_dialog - automatically brings up the respawn dialog if all units are unconscious.

JIP_spawn_dialog - the mission maker can now set the amount of time before JIP players can access the respawn dialog when they first join the mission - see C. This option was introduced for players who join some time after the mission start. When implemented a dialog appears for the JIP player so they can press a button and be teleported to a spawn point closer to the action so they don't have to spend 10 minutes getting to the front line.

nearest_teammate_dialog - measures the distance between the unconscious unit and the nearest friendly unit if the set a distance is exceeded the respawn dialog automatically appears

unconscious_markers - switches on/off the automatic appearance of markers on all player's maps showing where the unconscious unit is.

follow_cam - toggles the camera to either (0) focus on the unconscious player's body only or (1) follow the nearest friendly alive unit within a specified distance (see below).  In the latest version you can select which unit to follow by pressing the A and D keys to cycle through units. The W and S keys change the camera's perspective.  You can also turn on (N key) the night vision cam in follow/free camera mode.

call_out_function - Toggles on the alpha call_out function which causes the unconscious player to call out at random intervals (between 15 and 35 seconds) to help you find his body and revive him. Can be used as an alternative to the unconscious markers for locating downed players or in addition for added immersion. NB: If custom sounds are to be used in your mission a config file, config.cpp, for custom sounds is located in the dialogs subfolder of the revive_sqf folder and this will need to be changed. If you do not want to use the sound option and want to reduce the size of your mission then set call_out_function = 0, delete the sound folder and also delete this line from the description.ext file

#include "revive_sqf\dialogs\config.cpp"


revive_timer - toggles the revive timer option.   This option allows mission makers to specify a revive time limit and if the time runs out the player respawns or dies.  Read more about the options for this feature in Section G below.

heal_yourself - adds an action to the player to heal himself if damage is within a range specifiable by the mission maker (damage 0.1 - 0.3). The number of times this option is available per revive is also settable.

goto_revive - if set to 1 the closest playable AI unit automatically moves to and revives an unconscious unit if it is within the radius set by the mission designer in section J.  If set to 0 the group leader must order the AI unit to the unconscious comrade and once it is within a 4 metre radius it will revive him.

respawn_at_base_addWeapons option - allows you to specify what weapons the players respawn at base with if you do not want them to spawn at base with the weapons they died with.

unconscious_drag - players can drag bodies of other unconscious players and playable AI

water_dialog -  Allows the mission maker to specify whether the players get a wash ashore dilaog when they die in the water. If pressed the wash ashore dialog will cause a player to wash towards the "center" marker until land is reached. He will then die and become unconscious. This "second death" will effect the number of deaths in the players score but not the number of revives remaining.

QG_animation - Allows you to choose whether the script uses the additional Queens Gambit unconscious animations. For vanilla ArmA set this parameter to 0.

Section B

The next section should be recognisable to players who have used these scripts in the past and its where the mission designer specifies the unit names that will use these script's.

NORRN_player_units = ["alpha_1","alpha_2","alpha_3","alpha_4"];

NB: All playable units that you wish to use these scripts must be named in the editor and their names must be included in this array.  Also any non-playable AI (ie. non-respawning units) in the playable revive groups must be named in the editor but do not include their names in this array.  If grouped non-playable AI are not named in the editor it will cause error messages when a player calls for help or a unit in the group is revived.

Section C

This section is where you can specify the number of respawn-points that missions uses and the marker names.

IMPORTANT: Make sure if you don't want to use a respawn point that you place a "" as the respawn markers name (eg. see Base_4 above). Also as the names of these markers now appear on the respawn buttons automatically make sure they are not more than 11 lower case characters in length.

NB: see the "explanation of additional features" section for more info on mobile respawn options

no_respawn_points =0; These spawn points only become available when there are no enemy units within a 50 metre radius of the marker.

NB: It would be a good idea to place these spawn points where the players are unlikely to be shot and they must be somewhere reasonable out in the open (ie. not to close to a wall etc) otherwise the player will be slightly repositioned by the game when he teleports so test these.


Base_1 = "";  Respawn base locations
Base_2 = "";
Base_3 = "";
Base_4 = "";


time_b4_JIP_spawn_dialog = 10000; "time_b4_JIP_spawn_dialog" variable is the amount of mission time that must pass before the JIP players can access the respawn dialog when they first join the mission.

Base_free_respawn = [1,0,0,0]; The "Base_1_respawn " array allows you to set whether you would like to give the units the option of respawning at enemy occupied respawn points ie the 50 metre enemy unit radius does not apply. Each number of the array corresponds to each respawn point. A 0 stops players from respawning at enemy occupied spawns a 1 allows spawning eg. [1,0,0,0] - you can respawn at Base_1 even if enemy units are close by but you cannot spawn at the other bases if occupied by the enemy.

mobile_spawn = 0;  Enable mobile respawn

mobile_base_start = ""; Base for the mobile respawn option

mobile_man = objNull; - place name of unit here or if not used make sure set as objNull 

Section D

This is where you can specify what type of unit can revive and what side the scripts work for.

For instance if you want to use these scripts with independent troops and all independent troops can revive other players then just place "soldierGB" in the can_revive and can_be_revived variable. If you want to use these scripts so that two sides can revive each other (as in the example mission) then place the generic second side unit name in the "can_be_revived_2" slot. If you don't want to include a second side make sure you place a "" instead of the soldier type. The can_revive variables can now be used to specify a single unit type, for instance medics (eg. soldierWMedic), if you only wish give medics the capability to revive other units. The soldier classes are organised like a logical tree. With the classes further up the tree being a more generic type. For more information check out the soldier class tree available on this page: http://www.ofpec.com/COMREF/armavehicles.php. Also make sure that if you have two sides defined as enemies in section E that you only define units from a single side in this section and vice versa.

can_revive = "soldierWB";
can_revive_2 = "";
can_be_revived = "soldierWB";
can_be_revived_2 = "";

Section E

This next section allows you to specify the number of enemy teams ie. no_enemy_teams var (up to 2) in your mission and will affect the ability of players to respawn at the no_respawn_points specified in section C.

no_enemy_sides = 1; - For the no_enemy_sides variable: a "0" signifies that you do not want to prevent players from spawning at any of the spawn points; a "1" that units from enemy_side_1 will prevent players from respawning at a spawn point if a side 1 unit is within 50 metres of the spawn point; and a "2" signifies that if units from either sides 1 or 2 are within a 50 meter radius of the spawn point it will prevent players from respawning there. If you only want to use one enemy side make sure you have "" as the second side's name (as in the above example). Also make sure that if you have two sides defined as enemies in section E that you only define units from a single side in section D and vice versa.

enemy_side_1 = "EAST";
enemy_side_2 = "";

Section F

These next options are linked to the camera script and allow the players to spectate other team members and friendly sides while unconscious. Friendly sides can be "EAST", "WEST","RESISTANCE" etc. If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST" ie do not leave these variables blank if using the follow cam option (//array no.7)

enemy_units_1 = "soldierEB";
enemy_units_2 = "";

allied_side_1 = "WEST";
allied_side_2 = "WEST";

Section G

This section deals with the respawn options. Probably the place where most tweaking is done. The code allows you to specify the number of revives each player receives before being declared dead and having to disconnect and rejoin the server to continue playing or use param2 as suggested above.

max_respawns = param2;  In this example the maxium number of respawns is taken from the MP lobby. Generally the preferred method but could also be hard coded by the mission designer.

revive_time_limit = 180; Amount of time on the revive counter.

respawn_position = 3; the revive time limit can be set here, which specifies the amount of time before the unit: respawns at _base_1 (_respawn_position = 0); the closest available respawn point to where the unit died (_respawn_position = 1); the player's choice of respawn points(respawn_positon = 2) or dies (respawn_positon = 3).

revive_damage = 0; You can specify the amount of damage the player has following revival.

visible_timer = 1;  Enable/Disable the counter timer.

unconscious_music = 0; Enabl/ Disable the unconscious music - music must appear as unc_theme in music.hpp

Section H

The next variables allow you to set: the amount of time it takes for the respawn dialog to appear after you fall unconscious and the distance that a friendly unit must be away to trigger the respawn dialog

NB: The amount of time it takes for the respawn dialog to appear by default is approximately 12 seconds (ie. respawn_button_timer = 0). If you don't want to use this option set this to a high number like 100000.

respawn_button_timer = 10000;  

Section I

The next section adds an action to the player to heal himself if damage is within a range specifiable by the mission maker (eg. damage 0.1 - 0.5).

Note: Make sure this option is disabled if using the revive with damage option.

no_of_heals = 1; the number of times this option is available per revive.                                 

lower_bound_heal = 0.1;                         

upper_bound_heal = 0.5; if the damage exceeds this setting the action to heal oneself disappears.

Section J

AI Enabled revive options

goto_revive = 1; specifies whether the AI moves to unconscious units and revives.

AI_smoke = 0; determines whether AI will throw smoke, if available in inventory, before moving to revive units - best to only use this if used in conjunction with view block grenades

AI_aware = 0; If the AI goto revive option is enabled a second option can also be nebaled which will send a second AI unit to cover the reviver

AI_cover = 1; If this option is enabled the AI reviver will not move to revive a player until all known enemy units within 50 metres are killed

call_for_AI_help = 1; Toggles the option to allow players to call for help from AI units and players by pressing a button while unconscious

goto_revive_distance = 500; the distance that playable_AI_team mates will travel to revive unconscious team members.

Section K

The next variable allows you to set the maximum distance that the unconscious camera will follow other team members.  Whether the unconscious camera will only focus on the unconscious player or allow spectating of other units and the view height for the top down camera.

follow_cam_distance = 250;

follow_cam_team = 0;

top_view_height = 70;

Section L

These settings are used with the all dead dialog and allows you to specify whether this dialog appears when all players are unconscious.

all_dead_player = 0; (_all_dead_player = 1)                   

all_dead_distance = 250;   all revivable units within a set distance (_all_dead_player = 0, _all_dead_distance = 250)      

Section M

If respawn at base weapons option enabled you can specify what weapons players respawn with.

respawn_at_base_magazines = ["30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag"];

respawn_at_base_weapons = ["M4"];

Section N

Just ignore the last lines of the init.sqf as there is nothing to configure here and you risk stuffing up the functioning of the script.