Explanation of Additional Features

By norrin

Mobile Respawn Options

It is now possible to implement a built-in mobile respawn point as one of the respawn buttons in the unconscious dialogs.  The mobile spawn point can be deployed by either a vehicle see A or a man see B below.

A. To set up the mobile vehicle respawn point:

1. create a vehicle to act as a mobile respawn point in the editor, name it “r_mobile_spawn_vcl” and put this in the vehicles init line:

this addEventHandler ["GETIN",{if ((_this select 1) == "driver") then {NORRN_landy_script = [_this select 0, _this select 2] execVM "revive_sqf\mobile\mobile_spawn.sqf"}}];this addEventHandler ["GETOUT",{[_this select 0] execVM "revive_sqf\mobile\mobile_remove_spawn.sqf"}]; call{[this, 30] execVM "revive_sqf\mobile\vcl_respawn.sqf"}

Where 30 in the last line is the time before the mobile_respawn_vcl respawns after being destroyed

2. In the revive_init.sqf set:

mobile_spawn = 1;

3. Place a marker in the editor where the mobile respawn vehicle starts and give it a name such as “Base” in

mobile_base_start = "Base";

(preferably make this an empty marker so it doesnot show-up in the mission.

4. Create a second marker called eg “mobile” on top of the “Base” marker and put the name of this marker in the revive_init.sqf

Base_1 = "Mobile";

Here's how it works

Jump into the landrover and you'll get the action to deploy the camo. Just ignore it to start with and start driving the vehicle and the action will disappear. Stop the vehicle and switch off the engine the action to deploy will reappear.

Deploy the camo, you'll get your netting, ammo crate and the respawn point will be moved to the location of the landrover. You'll also get the option to stow the camo but ignore that for the time being.

Jump out of the vehicle and respawn and you'll reappear next to the landrover. Jump back in the vehicle and the action to stow the camo will reappear. Stow the camo and drive off. If you die while the camo is stowed then the respawn point is back at the flag.

If you destroy the vehicle while the camo is deployed the camo and ammo crates disappear and the vehicle respawns at base after a settable amount of time. The respawn point is also reset to the flag.

The mobile spawn marker only appears and is accessable as a spawn point when deployed.  You can also set up the enemy control of the mobile respawn points as you normally would for static respawn markers.

Restrictions

Only the vehicle's driver will get the option to deploy camo and he must get in the vehicle in the driver's position for it to appear (he can't get in the back and then move to the driver's position).

If the actions don't appear just get in and out of the vehicle as driver a 2nd time.

NB: The engine must be off for the actions to appear

Only the first respawn point (ie _Base_1) can be a mobile spawn point.

B. To set up the player mobile respawn point:

1. If you use this feature you'll need to put the unit name of the mobile spawn player in the revive_init.sqf 

mobile_man = alpha_1;

If you do not use this feature make sure you set

mobile_man = objNull;

The action to create a mobile spawn only appears in the players menu if he is not moving and he is not in water.  The option to stow the mobile spawn point appears if he is with approx 5 metres of the MASH tent.

This is not designed to be used at the same time as the vehicle mobile respawn.

 

Respawning on the aircraft carrier - Many thanks to Matt Rochelle for this!

If you want to use DaSquade and Hawks aircraft carrier as a respawn point then then you’ll need to do the following.

1. Place a Medical M113 Onto the Carrier and name it "spawn_carr"

2. Open revive_init.sqf and use the following code as a guide

no_respawn_points = 3;

Base_1 = "Mobile";

Base_2 = "Base";

Base_3 = "Carrier";

Base_4 = "";

time_b4_JIP_spawn_dialog = 10000;

Base_1_respawn = [1,0,0,0];

mobile_spawn = 1;

mobile_base_start = "Mobile";

As you can see the carrier has been added  Carrier as a respawn option. Select this and you will spawn on the carrier marker.

3. - Create a Marker on the map somewhere on some island far out the way called "Carrier" and make a 100x100 trigger around the marker called "cartrig" = activation present / bluefor etc

4.- Make a folder called "Scripts" in your mission dir.. then make a SQF script called "Groups.sqf" and add the following into the script:

//debug//

//hint "Groups.sqf working";

//_array = [unit1, unit2, unit3];

while {true} do

{

            _newacts = [];

            waitUntil {player in list cartrig};

            _newaction = player moveInCargo spawn_carr;

            _newacts = _newacts + [_newaction];

            waitUntil {not (player in list cartrig)};

            player removeAction _Action;

            for [{_i=0}, {_i < count _newacts}, {_i=_i+1}] do

            {

                        //hint format["_newacts select _i %1",_newacts select _i];

                        player removeAction (_newacts select _i);

            };

};

5.  Now in the same "Scripts Folder make another sqf script called "pinit.sqf" and add the following to that:

_transf = [] execVM "scripts\groups.sqf";

6. Now the last script in the same folder call it "update.sqf" and add this code to that script:

//debug//

//hint "Update.sqf working";

if (not (local server)) exitwith {};

vdist=1500;

_transf = [] execVM "scripts\groups.sqf";

 

7.- Now ingame add a trigger to the map with the following settings

0Axis x 0Axis

Activation: None

Present

Countdown

Condition: local player

Activation: plays = [] execVM "scripts\pinit.sqf"

 

8. One last thing go into the mission dir and look for "init.sqs" if there is one if not create one and then add this code to it

;Client

onplayerconnected "server exec ""scripts\update.sqf""";

 

Anti-Water Code:

If you fall unconscious in deep water then the anti-water script allows you to swim to shore or board a boat as cargo (not the driver or gunner).  Once you reach the shore line you'll fall unconcious.  At no time can you shoot until after you are revived.  If the respawn in water dialog option is enabled the player will also get the option to "wash ashore".  If you wish to just swim then press escape to close the wash ashore dialog.

 

To Specify the number of revives at mission start-up:

You’ll need to create a parameter in the description.ext file like the one in the following example:

titleParam2 = "Number of Revives:";

valuesParam2[] = {1000,20,10,7,5};

defValueParam2 = 1000;

textsParam2[] = {"Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};

 

Infinite Revives

If you set the max_respawns value to 1000 either in the init.sqf or through a parameter defined in the description.ext you will no longer be prompted for the number of revives remaining, the number of revives until next bonus or the number of teamkills until next punishment as essentially you have an infinite number of lives and these values are meaningless.

 

Group-Leader Code

Firstly make sure that the group leader has a higher rank than the other squad members in the editor. Then if the units are moving in formation when the human group leader is killed and falls unconscious although the group leader retains the group members command icons in the bottom left of his screen the playable AI units will often reform on the 2IC.

Once the human group leader is revived however the playable AI units in his group are coded to rejoin formation.

 

Goto-Revive Code

If a playable AI unit is the designated reviver for more than one unconscious unit it will revive the closest unit first.