Jump to content
Arrhythmix

Nimitz Plane/Heli Respawn Template (works for LHDs)

Recommended Posts

So I've noticed a lot of issues with BI code not allowing to treat decks of ships as ground/canvas/terrain. Thankfully for the new [flyinHeightASL] function, I was able to get the respawns to almost near perfect. This code also allows for helicopters to spawn on decks with engines off after respawn by adjusting fuel. To make this work, place down a "Vehicle Respawn" module with desired delay, deserted distance and tickets. Original script can be found here : http://tspindler.de/arma/arma3/nimitz/experimental/%5bMP%5dRespawnModule.Stratis.7z I would like to thank whoever wrote the original script, since I could not find the original owner to credit for it. Example missions can be found here https://drive.google.com/drive/folders/0Bwqlot_7c6hOc3ZScHJjQmdDc28

 

Mods Required for Sample Mission:

 

@CBA_A3

@Nimitz

@F/A18

@USAF

 

Use this in the "Expression" field of the respawn module:

[(_this select 0), true] execVM "scripts\planeRespawn.sqf";
[(_this select 0), true] execVM "scripts\heliRespawn.sqf";

Position must be set to "Starting position" as well as "Position selection" to "Oldest" to prevent clipping issues or wreaks crashing into each other preventing overall respawn.
 

Below is the script that needs to be called "planeRespawn.sqf"

#define DECK 18
private ["_plane"];
_plane = param [0, ObjNull];
_foldWings = param [1, false];

if (isNull _plane) exitWith {};

// the plane actually starts flying, so we stop that ...
_plane allowDamage False;
_plane flyinHeightASL [15.4,15.4,15.4];
_plane setVelocity [0,0,0.2];
_plane hideObject true;
_plane engineOn false;
createVehicleCrew _plane;
sleep 1;
(driver _plane) action ["LandGear", _plane];
{deleteVehicle _x} forEach crew _plane;

if (_foldWings) then {
	// fold wings of F/A-18 and F-14
	/*[_plane] execVM "JS_JC_FA18\scripts\MISC\FA18_foldwings.sqf";*/
	_plane animate ["l_wingfold",1,true];
	_plane animate ["r_wingfold",1,true];
	_plane animate ["leftwing_parking",1,true];
	_plane animate ["rightwing_parking",1,true];
};

sleep 3;
_plane hideObject false;
_plane allowDamage true;
_plane action ["landinggear", _plane];
_plane engineOn false;
_plane setDamage 0;

Below is the script that needs to be called "heliRespawn.sqf"

#define DECK 18
private ["_heli"];
_heli = param [0, ObjNull];
if (isNull _heli) exitWith {};

// the plane actually starts flying, so we stop that ...
_heli setfuel 0.0;
_heli allowDamage False;
//_heli setpos [getpos _heli select 0, getpos _heli select 0, 15.7];
_heli setposasl [position _heli select 0, position _heli select 1, 15.7]; 
_heli flyinHeightASL [15.7,15.7,15.7];
_heli setVelocity [0,0,0.2];
_heli setDamage 0;
_heli hideObject true;
createVehicleCrew _heli;
sleep 1;
{deleteVehicle _x} forEach crew _heli;
sleep 3;
_heli hideObject false;
_heli allowDamage true;
_heli engineOn false;
_heli setfuel 1;
_heli setDamage 0;
  • Like 4

Share this post


Link to post
Share on other sites

Hey @Arrhythmix - I have this working great on the ATLAS LHD especially single-player, lol but on my server it all works as normal but upon the choppers spawning and engines go off etc.
The crew get out and start walking around the LHD. They don't despawn or delete as they should do like on the single-player version in which I seen works great. Any idea on how to fix this please?

Thanks :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×