Animated C130 crashes - Eventually dropping carepackages at way points

Just to confirm this is working on Panthera 1.8 with animated helicrash. Big thanks to Gorsy & Gaga!!
 
We have found that increasing the height on the plane helps people spot them a little easier in my server. You will also need to up the delay in the carepackage code to stop the parachute being removed to early.

I use them to drop base-building supplies from an osprey :D I use a a random safepos for the locations. I love the flares the packages shoot at night. I have increased the number and duration of these to make them a little easier to spot.

My next plan is to get the Osprey to go into autohover before it drops the packages, and then maybe try to open the door at the back first....
 
So, if I add in the part for care packages, the only difference is that care packages get dropped in-between starting point and crash - is that accurate? Sorry...still working on my coffee and my head is groggy :cool:
 
they are 2 seperate scripts, the first creates a heli-crash type,

the 2nd does the carepackages and deletes the vehicle without flying
 
Just managed to make a chinook fly over noob spawn areas and air drop vehicles every so often, that will auto despawn on server restart. Just a few things left to do with it, then ill post a tut for it.

And also update the ones on the front page
 
Do you know if the C130J_US_EP1, CH47_EP1_DZ, AN2_DZ and Mi17_Civilian_DZ classes work with this in Chernarus Epoch? Anyone Tested?

Talking about the fly over and care packages not crashing and creating a wreck.

Also the Care Packages, what is the object that is dropped?
Could it be a Random Chance Ammo Box/Crate with calls to a Fill Script?

http://dayzsuperhive.co.uk/arma-ii-ammo-boxes.html

From Lzryde Fill Ammo Box Script 0.2

Code:
// Settings
_amountWeapon = 2;
_amountAmmo = 4;
_amountFood = 4;
_amountTools = 1;
_refreshTime = 3600000; // Shouldn't refill until restart
 
_this allowDamage false;
 
// Loop forever
while {true} do
{
 
// Clear box
clearWeaponCargo _this;
clearMagazineCargo _this;
 
// Fill box
 
_this addMagazineCargo ["ItemSodaPepsi", _amountFood];
_this addMagazineCargo ["Arrow", _amountAmmo];
_this addWeaponCargo ["M24", _amountWeapon];

etc etc..

Even setup a chance function to have a range of supplies spawning in 3 - 4 Crate Items.

Cheers,

Bungle
 
Anyone know why i keep getting this message in my rpt log.

12:56:26 "C130StartCRASHSPAWNER: started flying from [6993.7,173.053,300] to [4840.24,8308.12] NOW!(TIME:2134||LT:HeliCrash_No50s)"
12:56:26 Cannot create non-ai vehicle an2,
12:56:27 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #1 on [11698.5,9959.03]"
12:56:27 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #2 on [5022.68,8930.42]"
12:56:27 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #3 on [4619.31,7012.74]"
12:56:27 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #4 on [4473.53,4596.19]"
12:56:27 "C130CRASHSPAWNER: Adding Pre-POC-Waypoint #5 on [5736.97,7041.77]"
12:56:27 "C130EndCRASHSPAWNER: just exploded at [0,0,0]!, "
12:56:40 Cannot create non-ai vehicle an2wreck,
12:56:40 "C130CRASHSPAWNER: numLoot: '8', _index: '19', _weights: '', _cntItemTypes: '21', config: 'bin\config.bin/CfgBuildingLoot/HeliCrash_No50s'"
12:56:40 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '2', ItemType: '["M14_EP1","weapon"]', Item: '"M14_EP1"'"
12:56:40 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '14', ItemType: '["Skin_Camo1_DZ","magazine"]', Item: '"Skin_Camo1_DZ"'"
12:56:40 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '16', ItemType: '["G36C","weapon"]', Item: '"G36C"'"
12:56:40 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '14', ItemType: '["Skin_Camo1_DZ","magazine"]', Item: '"Skin_Camo1_DZ"'"
12:56:40 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '18', ItemType: '["G36A_camo","weapon"]', Item: '"G36A_camo"'"
12:56:41 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '0', ItemType: '["FN_FAL","weapon"]', Item: '"FN_FAL"'"
12:56:41 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '10', ItemType: '["MedBox0","object"]', Item: '"MedBox0"'"
12:56:41 "CRASHSPAWNER: Loot Table: 'HeliCrash_No50s', ItemTypes: '[["FN_FAL","weapon"],["bizon_silenced","weapon"],["M14_EP1","weapon"],["FN_FAL_ANPVS4","weapon"],["Mk_48_DZ","weapon"],["M249_DZ","weapon"],["BAF_L85A2_RIS_SUSAT","weapon"],["DMR","weapon"],["","military"],["","medical"],["MedBox0","object"],["NVGoggles","weapon"],["AmmoBoxSmall_556","object"],["AmmoBoxSmall_762","object"],["Skin_Camo1_DZ","magazine"],["Skin_Sniper1_DZ","magazine"],["G36C","weapon"],["G36C_camo","weapon"],["G36A_camo","weapon"],["G36K_camo","weapon"],["100Rnd_762x54_PK","magazine"]]', Index: '4', ItemType: '["Mk_48_DZ","weapon"]', Item: '"Mk_48_DZ"'"
12:56:41 "C130CRASHSPAWNER: Crash completed! Wreck at: [0,0,0] - Runtime: 14 Seconds || Distance from calculated POC: 1e+010 meters"
12:56:41 "C130CRASHSPAWNER: 99% chance to start a crashing with loot table 'MilitarySpecial' at 2848.19"
12:56:54 "CLEANUP: DELETED 7 LOOT BAGS"
 
use AN2_DZ as heli model ... and the crashmodel.. that an2wreck does not exist.. thats why its not working
 
Still keep meaning to get on my cherno map and find a wreck that does work for cherno that looks like the plane, there is one :p keep forgetting lol Player 2 deals with the cherno pbo and i deal with the panth usually, w0rking on so many things at once makes me forget other stuff alot lol. Ill try and remember tonight to get the updated pbo off him and check which wreck is for the biplanes theres only 3 types of biplanes if i remember rightly so has to be one of them
 
Do you know if the C130J_US_EP1, CH47_EP1_DZ, AN2_DZ and Mi17_Civilian_DZ classes work with this in Chernarus Epoch? Anyone Tested?

Talking about the fly over and care packages not crashing and creating a wreck.

Also the Care Packages, what is the object that is dropped?
Could it be a Random Chance Ammo Box/Crate with calls to a Fill Script?

http://dayzsuperhive.co.uk/arma-ii-ammo-boxes.html

From Lzryde Fill Ammo Box Script 0.2

Code:
// Settings
_amountWeapon = 2;
_amountAmmo = 4;
_amountFood = 4;
_amountTools = 1;
_refreshTime = 3600000; // Shouldn't refill until restart
 
_this allowDamage false;
 
// Loop forever
while {true} do
{
 
// Clear box
clearWeaponCargo _this;
clearMagazineCargo _this;
 
// Fill box
 
_this addMagazineCargo ["ItemSodaPepsi", _amountFood];
_this addMagazineCargo ["Arrow", _amountAmmo];
_this addWeaponCargo ["M24", _amountWeapon];

etc etc..

Even setup a chance function to have a range of supplies spawning in 3 - 4 Crate Items.

Cheers,

Bungle


If the vehicle will spawn on your server, then it will work.

also you can change the _boxtype to anything
 
Cool :) thanks. Will try it out. So the crashmodel will be AN2_DZwreck or the same?

Give it a try, there is deffenatly a biplane wreck for cherno, it might not be AN2_DZWreck tho, it cud be the wreck from one of the other biplanes

dayzsuperhive, sucks balls when it comes to listing wrecks, I found out the hard way, after spending hours hunting down the c130JWreck to replace the buggy as hell c130_Wreck_ep1 one, turns out most wrecks are just

MV22Wreck etc
 
So I got the ospreys working with opening doors etc, auto hovering isn't as reliable as I would like, I wanted them to hover much higher but it seems the only way to make them do it is to tell them to land.

Might have a go at making some invisible helipads for it to "land" on before dropping the package but either way this code has been working pretty well for me today.

The osprey flies to a random waypoint, drops in height, opens its doors and *should* hover not always unfortunately. It will drop the package, let off a flare and close the doors and fly away again.

I made the osprey itself fire a flare at night too making the packages a little easier to spot :)

Apologies for the ugly code I was just running it as a replacement to Gorsys original AN2 script, too lazy to rename the log entries etc whilst I'm still working on it

Code:
//Animated Helicrashs for DayZ 1.7.6.1
//Version 0.2
//Release Date: 05. April 2013
//Author: Grafzahl
//Thread-URL: http://opendayz.net/threads/animated-helicrashs-0-1-release.9084/
 
private["_useStatic","_crashDamage","_lootRadius","_preWaypoints","_preWaypointPos","_endTime","_startTime","_heliStart","_deadBody","_exploRange","_heliModel","_lootPos","_list","_craters","_dummy","_wp2","_wp3","_landingzone","_aigroup","_wp","_helipilot","_crash","_crashwreck","_smokerand","_staticcoords","_pos","_dir","_position","_num","_config","_itemType","_itemChance","_weights","_index","_iArray","_crashModel","_lootTable","_guaranteedLoot","_randomizedLoot","_frequency","_variance","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_permanentFire","_crashName", "_aaa", "_blacklist"];
 
//_crashModel= _this select 0;
//_lootTable= _this select 1;
_guaranteedLoot = _this select 0;
_randomizedLoot = _this select 1;
_frequency= _this select 2;
_variance= _this select 3;
_spawnChance= _this select 4;
_spawnMarker= _this select 5;
_spawnRadius= _this select 6;
_spawnFire= _this select 7;
_fadeFire= _this select 8;
_randomizedWP= _this select 9;
_guaranteedWP= _this select 10;
 
_chutetype = "ParachuteMediumEast";
_boxtype = "Misc_cargo_cont_net1";
_useStatic = false;
 
 
 
 
 
if(count _this > 11) then {
_crashDamage = _this select 11;
} else {
_crashDamage = 1;
};
 
 
diag_log(format["PLANE: Starting spawn logic for animated AN2 Carepackage drops - written by Grafzahl, modded by fofinho [CD:%1]", _crashDamage]);
 
while {true} do {
 
_preWaypoints = 6;
 
private["_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos"];
// Allows the variance to act as +/- from the spawn frequency timer
_timeAdjust = round(random(_variance * 2) - _variance);
_timeToSpawn = time + _frequency + _timeAdjust;
 
//Random Heli-Type
_heliModel = "MV22";
 
//Random-Startpositions, Adjust this for other Maps then Chernarus
_heliStart = [[6993.7007,173.05298,300],[1623.715,218.18848,300]] call BIS_fnc_selectRandom;
 
 
_crashName= getText (configFile >> "CfgVehicles" >> _heliModel >> "displayName");
 
diag_log(format["PLANE: %1%2 chance to start a %3 Carepackagedrop at %4 with %5 drop points", round(_spawnChance * 100), '%', _crashName, _timeToSpawn, _preWaypoints]);
 
// Apprehensive about using one giant long sleep here given server time variances over the life of the server daemon
while {time < _timeToSpawn} do {
sleep 5;
};
 
_spawnRoll = random 1;
 
// Percentage roll
if (_spawnRoll <= _spawnChance) then {
 
//Spawn the AI-Heli flying in the air
_startTime = time;
_crashwreck = createVehicle [_heliModel,_heliStart, [], 0, "FLY"];
 
//Make sure its not destroyed by the Hacker-Killing-Cleanup (Thanks to Sarge for the hint)
_crashwreck setVariable["Sarge",1];
 
_crashwreck engineOn true;
_crashwreck flyInHeight 250;
_crashwreck forceSpeed 120;
_crashwreck setspeedmode "NORMAL";
 
/*
//Create an Invisibile Landingpad at the Crashside-Coordinates
_landingzone = createVehicle ["HeliHEmpty", [_position select 0, _position select 1], [], 0, "CAN_COLLIDE"];
_landingzone setVariable["Sarge",1];
 
*/
 
//Only a Woman could crash a Heli this way...
_aigroup = creategroup civilian;
_helipilot = _aigroup createUnit ["SurvivorW2_DZ",getPos _crashwreck,[],0,"FORM"];
_helipilot moveindriver _crashwreck;
_helipilot assignAsDriver _crashwreck;
 
sleep 0.5;
 
 
_unsorted = [];
 
for "_x" from 1 to _preWaypoints do {
 
 
_preWaypointPos = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
 
 
_unsorted = _unsorted + [_preWaypointPos];
 
};
 
 
 
 
_sorted = [];
_pos = [800,2400];
 
{
     _closest = _unsorted select 0;
     {if ((_x distance _pos) <= (_closest distance _pos)) then {_closest = _x}} forEach _unsorted;
 
     _sorted = _sorted + [_closest];
 
_helper = [];
_i=0;
while {!([_helper, _closest] call BIS_fnc_areEqual)} do { 
_helper = _unsorted select _i;
_i=_i+1;
};
 
_unsorted set [(_i-1),"delete_me"];
_unsorted = _unsorted - ["delete_me"];
} forEach _unsorted;
 
diag_log(format["PLANE: %1 started flying from %2 to first waypoint NOW!(TIME:%3)", _crashName,  str(_heliStart), round(time)]);
 
 
 
for "_x" from 0 to ((count _sorted)-1) do {
 
 
//_preWaypointPos = [_spawnMarker,0,8000,10,0,1000,0,_blacklist] call BIS_fnc_findSafePos;
diag_log(format["PLANE: Adding DROPWaypoint #%1 on %2", (_x+1),str(_sorted select _x)]);
_wp = _aigroup addWaypoint [(_sorted select _x), 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
 
waituntil {(_crashwreck distance (_sorted select _x)) <= 1600  };
 
_crashwreck animate ["ramp_top",1]; //open the top part of the ramp
_crashwreck animate ["ramp_bottom",1]; //open the bottom part of the ramp
_crashwreck setVariable ["mv22_ramp", 1, true]; //set it open
_crashwreck LAND "GET IN";
_crashwreck forceSpeed 30;
 
sleep 5;
 
waituntil {(_crashwreck distance (_sorted select _x)) <= 600 || not alive _crashwreck || (getPosATL _crashwreck select 2) < 50 || (damage _crashwreck) >= _crashDamage };
 
 
diag_log(format["PLANE IS AT DROPWAYPOINT #%1 on %2", (_x+1),str(getpos _crashwreck)]);
 
 
sleep 3;
 
_flare = "F_40mm_White" createVehicle [getPos _crashwreck select 0, getPos _crashwreck select 1, (getPos _crashwreck select 2) +250];
 
_flare setVariable["Sarge",1];
 
nul = [_chutetype, _boxtype, _helistart, _crashwreck, _randomizedLoot, _guaranteedLoot] spawn server_carepackagedrop;
 
 
_crashwreck LAND "NONE";
_crashwreck flyInHeight 250;
_crashwreck forceSpeed 120;
 
sleep 5;
 
_crashwreck animate ["ramp_top",0]; //close the top part of the ramp
_crashwreck animate ["ramp_bottom",0]; //close the bottom part of the ramp
_crashwreck setVariable ["mv22_ramp", 0,true]; //set it closed
 
if (not alive _crashwreck || (damage _crashwreck) >= _crashDamage || (getPosATL _crashwreck select 2) < 5 ) exitWith {diag_log(format["DROPPED 1 LAST PACKAGE WHILE GETTING SHOT DOWN #%1 on %2", _x,str(getpos _crashwreck)]); };
 
};
 
 
_wp2 = _aigroup addWaypoint [_heliStart, 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointBehaviour "CARELESS";
diag_log(format["PLANE IS AT END WAYPOINT on %1",str(_heliStart)]);
waituntil {(_crashwreck distance _heliStart) <= 1000 || not alive _crashwreck || (getPosATL _crashwreck select 2) < 5 || (damage _crashwreck) >= _crashDamage};
 
sleep 5;
 
//Clean Up the Crashsite
deletevehicle _crashwreck;
deletevehicle _helipilot;
diag_log(format["PLANE DELETED"]);
 
 
 
_endTime = time - _startTime;
diag_log(format["PLANE: %2 Carepackagedrops completed! Runtime: %1 Seconds", round(_endTime), _preWaypoints]);
 
 
};
 
 
};

Thanks grafzahl, gorsy, gaga, and kind sir for the osprey door code.
 
Cool will look at this later when i get chance , I did attempt it with a chinook for awhile but it kept blowing up, will have to lower the height it spawns in at
 
Cool will look at this later when i get chance , I did attempt it with a chinook for awhile but it kept blowing up, will have to lower the height it spawns in at


Im just sort of working round the issue right now - telling it to land but stopping it before it can, which usually results in autohover

I think to get the result I really want which is it hovering at about 250 metres height so the parachute is more visible will require an invisible landing pad for a drop point. Thats not true with the helis or AN2 of course though.

Should be easy to take my code and have it work for the chinooks though, although I imagine sleep times, distances etc will need tweaking. I think because they are a chopper you can make them hover a lot easier than with an osprey....
 
Back
Top