Animated C130 crashes - Eventually dropping carepackages at way points

Soooo gaga got the Carepackages working, Nice Job!

How to make an AN2 drop carepackages as it flys over....

Step 1

Download the files below and store them in your COMPILES folder in your Server.pbo
http://www.share-online.biz/dl/YK5XOENMFE

Step 2

Open the Server_Cleanup.fsm located in your system folder inside your server.pbo

Search for

//Check for Hackers

Replace the line starting with...

" if(vehicle _x != _x && !(vehicle _x in _safety)

with

" if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""Sarge"",0] != 1)) then {" \n

Step 3

Open your Server_mointor.sqf located in the system folder in your server.pbo

Add the following text to the very bottom

Code:
nul =    [
                6,        //Number of the guaranteed Loot-Piles at the Crashside
                3,        //Number of the random Loot-Piles at the Crashside 3+(1,2,3 or 4)
                (50*60),    //Fixed-Time (in seconds) between each start of a new Chopper
                (15*60),      //Random time (in seconds) added between each start of a new Chopper
                0.75,        //Spawnchance of the Heli (1 will spawn all possible Choppers, 0.5 only 50% of them)
                'center', //'center' Center-Marker for the Random-Crashpoints, for Chernarus this is a point near Stary
                8000,    // [106,[960.577,3480.34,0.002]]Radius in Meters from the Center-Marker in which the Choppers can crash and get waypoints
                true,    //Should the spawned crashsite burn (at night) & have smoke?
                false,    //Should the flames & smoke fade after a while?
                2,    //RANDOM WP
                3,        //GUARANTEED WP
                1        //Amount of Damage the Heli has to get while in-air to explode before the POC. (0.0001 = Insta-Explode when any damage//bullethit, 1 = Only Explode when completly damaged)
            ] spawn server_spawnAN2;

STEP 4
Add the following to your server_funtions.sqf

find the part for the heli crash sites, shown in the post above

and past the following on the lines below it

server_spawnAN2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnAN2.sqf"; server_carepackagedrop = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_carepackagedrop.sqf";

CONFIRMED WORKING


So this works perfectly ingame except for the loot spawning portion. Ive visisted every coordinate, all which are beside the crates and have not seen a single item. Here is the loot spawning from the .rpt log.

"
22:04:22 "PLANE IS AT DROPWAYPOINT #3 on [12472.4,4293.45,100.103]"
22:04:24 "PLANE IS AT END WAYPOINT on [6993.7,173.053,300]"
22:04:41 "CAREPACKAGE: Loot spawn at '[12546,4326.31,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12548.7,4333.28,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12544.4,4328.79,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12544.2,4331.1,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12544.4,4331.99,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12543.5,4330.33,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12547.2,4334.9,0]' with loot any"
22:04:41 "CAREPACKAGE: Loot spawn at '[12543.2,4332.01,0]' with loot any"
"

Its not specifying loot type, may be related?
 
What gaga said above about selecting the loot step by step is right, if u mess up one item, chances are... none will spawn
 
//_chutetype, _boxtype, _helistart, _crashwreck
private["_chutetype", "_boxtype", "_helistart", "_crashwreck", "_randomizedLoot", "_guaranteedLoot", "_chute", "_chutetype", "_helistart", "_crashwreck", "_box", "_boxtype", "_num", "_weights", "_index", "_aaa", "_itemType", "_lootRadius", "_lootPos", "_pos", "_bam"];

_chutetype = _this select 0;
_boxtype = _this select 1;
_helistart= _this select 2;
_crashwreck= _this select 3;
_randomizedLoot = _this select 4;
_guaranteedLoot = _this select 5;

_lootRadius = 1;
//_lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom;

_chute = createVehicle [_chutetype,_helistart,[],0,"CAN_COLLIDE"];
_chute setVariable["Sarge",1];
_chute setPos [(getpos _crashwreck select 0), (getPos _crashwreck select 1), (getPos _crashwreck select 2)-10];

_box = createVehicle [_boxtype,_helistart,[],0,"CAN_COLLIDE"];
_box setVariable["Sarge",1];
_box setPos [(getpos _crashwreck select 0), (getPos _crashwreck select 1), (getPos _crashwreck select 2)-10];

_box attachto [_chute, [0, 0, 0]];

_i = 0;


while {_i < 45} do {
scopeName "loop1";
if (((getPos _box) select 2) < 1) then {breakOut "loop1"};

sleep 0.1;
_i=_i+0.1;
};


switch (true) do {
case not (alive _box): {detach _box;_box setpos [(getpos _box select 0), (getpos _box select 1), 0];};
case alive _box: {detach _box;_box setpos [(getpos _box select 0), (getpos _box select 1), 0];_bam = _boxtype createVehicle [(getpos _box select 0),(getpos _box select 1),(getpos _box select 2)+0];deletevehicle _box;};
};
_bam setVariable["Sarge",1];
deletevehicle _chute;

sleep 2;

_pos = [getpos _bam select 0, getpos _bam select 1,0];


_smoke = createVehicle ["SmokeShellred",_pos,[],0,"CAN_COLLIDE"];
_smoke setVariable["Sarge",1];

_flare = "F_40mm_white" createVehicle [getPos _bam select 0, getPos _bam select 1, (getPos _bam select 2) +150];
_flare setVariable["Sarge",1];



_num= round(random _randomizedLoot) + _guaranteedLoot;

//_config = configFile >> "CfgBuildingLoot" >> _lootTable;
_itemType = [["ItemTankTrap", "magazine"], ["ItemSandbag", "magazine"], ["ItemWire", "magazine"], ["WeaponHolder_PartGeneric", "object"], ["WeaponHolder_PartWheel", "object"], ["WeaponHolder_PartFueltank", "object"], ["WeaponHolder_PartEngine", "object"], ["WeaponHolder_PartGlass", "object"], ["WeaponHolder_PartVRotor", "object"], ["WeaponHolder_ItemJerrycan", "object"], ["ItemToolbox", "weapon"], ["ItemEtool", "weapon"], ["", "medical"]];
_itemChance = [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.01];

_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
_cntWeights = count _weights;


//Creating the Lootpiles outside of the _crashModel
for "_x" from 1 to _num do {
//Create loot
_aaa = random _cntweights;
_index = floor(_aaa);
_index = _weights select _index;
_itemType = _itemTypes select _index;


//Let the Loot spawn in a non-perfect circle around _crashModel
_lootPos = [_pos, ((random 2) + (sizeOf(_boxtype) * _lootRadius)), random 360] call BIS_fnc_relPos;
[_itemType select 0, _itemType select 1, _lootPos, 0] call spawn_loot;

diag_log(format["CAREPACKAGE: Loot spawn at '%1' with loot %2", _lootPos, _itemtype]);

// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
_nearby = _pos nearObjects ["ReammoBox", (sizeOf(_boxtype)+3)];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};

Loot looks fine, atleast im not notcing anything.. But it is early in the morning
 
just try the default code... if it doesnt occur there its a problem with the stuff u pasted in
 
Hi there, I'm standing around waiting to see if its worked....I looked at the rpt.log can someone tell me if this means its worked please?
Also is there a specific place I should wait to see if its worked?. I have blue phoenix admin tools and cant see it on my esp map though


Code:
5:48:16 "HIVE: Local Time set to [2013,6,7,8,48]"
5:48:18 "SAR_AI: Area & Trigger definition finalized"
5:48:18 "SAR_AI: Static Spawning for Helicopter patrols started"
5:48:18 "SAR_AI: Static Spawning for Helicopter patrols finished"
5:48:18 "SAR_AI: Static Spawning for infantry and heli patrols finished"
5:48:18 "CRASHSPAWNER: Starting spawn logic for Crash Spawner"
5:48:18 "CRASHSPAWNER: 75% chance to spawn 'Crashed UH-1Y' with loot table 'Military' at 2639"
5:48:18 "C130CRASHSPAWNER: Starting spawn logic for animated helicrashs - written by Grafzahl [SC:false||PW:5||CD:1]"
5:48:18 "C130CRASHSPAWNER: 99% chance to start a crashing AN2 Cargo Plane with loot table 'HeliCrash' at 700"
5:48:18 "PLANE: Starting spawn logic for animated AN2 Carepackage drops - written by Grafzahl, modded by fofinho [CD:1]"
5:48:18 "PLANE: 75% chance to start a AN2 Cargo Plane Carepackagedrop at 3778 with 4 drop points"
5:48:18 "CLEANUP: INITIALIZING CLEANUP SCRIPT"
5:49:31 "STARTING LOGIN: ["100750406",B 1-1-A:1 (mike) REMOTE]"
5:49:31 "LOGIN ATTEMPT: "100750406" mike"
5:49:31 "LOGIN LOADED: B 1-1-A:1 (mike) REMOTE Type: Survivor1_DZ"
5:49:32 "Adding MPHit EH for B 1-1-B:1 (mike) REMOTE"
5:49:32 "LOGIN PUBLISHING: B 1-1-B:1 (mike) REMOTE Type: Survivor2_DZ"
5:49:51 "DEBUG: needUpdate_objects=[189ae080# 1055730: uaz.p3d,189310c0# 1055731: atv.p3d,18930100# 1055732: atv.p3d,188c3040# 1055733: atv.p3d,18883040# 1055734: skodovka_blue.p3d,1bd3d0c0# 1055749: uh1h.p3d,1bcda080# 1055750: hilux1_civil_3_open.p3d,1bbf3040# 1055752: tractor_2.p3d,1bb3f040# 1055755: car_hatchback.p3d,1bb3e080# 1055756: car_hatchback.p3d,1bae8100# 1055757: fishing_boat.p3d,1ba88100# 1055759: volha.p3d,1ba150c0# 1055760: car_sedan.p3d,1b903040# 1055763: uaz.p3d,1b8e2080# 1055767: ikarus.p3d,1b8e0100# 1055769: tractor_2.p3d,1b8850c0# 1055770: v3s.p3d,1b81b040# 1055771: volha.p3d]"
5:49:51 "HIVE: WRITE: "CHILD:305:"1":[360,[6279.17,7810.05,0.00576782]]:0.611:""
5:49:51 "HIVE: WRITE: "CHILD:303:"1":[[[],[]],[["10Rnd_127x99_m107"],[5]],[[],[]]]:""
5:49:51 "HIVE: WRITE: "CHILD:306:"1":[["wheel_1_2_steering",1]]:0.394:""
5:49:51 "HIVE: WRITE: "CHILD:305:"2":[337,[3311.9,11271,0.00128174]]:0.2:""
5:49:51 "HIVE: WRITE: "CHILD:303:"2":[[[],[]],[["ItemTent"],[1]],[[],[]]]:""
5:49:51 "HIVE: WRITE: "CHILD:306:"2":[["motor",0.8]]:0.1:""
5:49:51 "HIVE: WRITE: "CHILD:305:"3":[50,[3684.02,5999.07,-0.000244141]]:0.2:""
5:49:51 "HIVE: WRITE: "CHILD:303:"3":[[[],[]],[["ItemTent"],[1]]



Many thanks

Robbie
 
Nevermind, I see it.

Woo hoo thanks a lot :) care packages working too, going to test mv22 after will report back after.

Many thanks

Robbie
 
I cant get a cargo plane to spawn as a wreck but I have an mv22 flying around, a cargo plane drops care packages and when the mv22 crashes ive changed it to a c130 wreck!!!! I'm happy with that! cant find a classname for a an mv22 and not sure it would work anyway.


Many thanks

Robbie
 
how do i add more loot or loot piles to the craepack drops, when i changed the

nul = [
6, //Number of the guaranteed Loot-Piles at the Crashside
3, //Number of the random Loot-Piles a

6 and 3 here i get errors in the rpt log and no loot spawns (from what i remember is said was not divisible by 9 r something)
 
Anyone tried this on Namalsk? I hope that the static cordinates are on the island and not in the sea.
 
how do i add more loot or loot piles to the craepack drops, when i changed the

nul = [
6, //Number of the guaranteed Loot-Piles at the Crashside
3, //Number of the random Loot-Piles a

6 and 3 here i get errors in the rpt log and no loot spawns (from what i remember is said was not divisible by 9 r something)
strange, anyways .. u can change it in the carepackage sqf .. line 56

_num = round(random _randomizedLoot) + _guaranteedLoot;

should work :X
 
when i change
_randomizedLoot = _this select 3;
_guaranteedLoot = _this select 9;

i get the following errors in the rpt log

_chute = c>
8:32:15 Error Zero divisor
8:32:15 File z\addons\dayz_server\compile\server_carepackagedrop.sqf, line 9
8:32:16 Error in expression <["if(getPlayerUID player == '86813446')th>
8:32:16 Error position: <"if(getPlayerUID player == '86813446')th>
8:32:16 Error Missing ""


and

_num = round(random _randomizedLoot) + _guaranteedLoo>
8:32:33 Error position: <random _randomizedLoot) + _guaranteedLoo>
8:32:33 Error random: Type Object, expected Number
8:32:33 File z\addons\dayz_server\compile\server_carepackagedrop.sqf, line 56
8:32:37 Error in expression <["if(getPlayerUID player == '86813446')th>
8:32:37 Error position: <"if(getPlayerUID player == '86813446')th>
8:32:37 Error Missing ""
8:32:37 Error in expression <["if(getPlayerUID player == '86813446')th>
8:32:37 Error position: <"if(getPlayerUID player == '86813446')th>
8:32:37 Error Missing ""

these errors continue on and on



if i change the 2 values back to default everything is fine

_randomizedLoot = _this select 4;
_guaranteedLoot = _this select 5;

any ideas?
 
Back
Top