Hey all, I've been running with these on my Pwnozor server for awhile, and realized most people think that care packages are a Bliss only option. Incorrect!
Here's what you need to do to get care packages, new wrecks like urals, UAZs, armored cars, even random buildings to spawn! Note, these use the heli crash position system, so open ground and in a certain radius of the center of the map, which is also editable.
Open up your dayz_server.pbo. Inside find your dayz_server>init> server_function.sqf. Inside this file, find spawn_heliCrash. This is your current helicrash spawn system. This can be edited, but I already have a thread about how to edit this here in this thread.
For the purpose of this, I am going to assume you know what many of the variables already are.
Here is the code for care packages. Credit for this goes to UnclearWall. I am unaware if anyone made this before him.
This gets inserted after the helicrash script.
Once you have that in and save, you need to open your system>server_monitor.sqf. All the way at the bottom, find:
//Spawn crashed helos
for "_x" from 1 to 6 do {
_id = [] spawn spawn_heliCrash;
//waitUntil{scriptDone _id};
};
If you did not already know, this is how many helicrashes will spawn on your server. After that, add:
Save your file, re-pbo it, and your server should now be spawning care packages!
Find out by reading the arma2oaserver.RPT file, and if you used the code above, that report will be telling you where the care packages are spawning at. It will look like:
And that's it for care packages!
Here's what you need to do to get care packages, new wrecks like urals, UAZs, armored cars, even random buildings to spawn! Note, these use the heli crash position system, so open ground and in a certain radius of the center of the map, which is also editable.
Open up your dayz_server.pbo. Inside find your dayz_server>init> server_function.sqf. Inside this file, find spawn_heliCrash. This is your current helicrash spawn system. This can be edited, but I already have a thread about how to edit this here in this thread.
For the purpose of this, I am going to assume you know what many of the variables already are.
Here is the code for care packages. Credit for this goes to UnclearWall. I am unaware if anyone made this before him.
Code:
diag_log ("DEBUG Care Packages processing... START");
spawn_Misc_cargo_cont_net1 = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log("DEBUG: Spawning a Misc_cargo_cont_net1 at " + str(_position));
_veh = createVehicle ["Misc_cargo_cont_net1",_position, [], 0, "CAN_COLLIDE"];
//dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
_num = round(random 9) + 5;
_config = configFile >> "CfgBuildingLoot" >> "Residential";
_itemType = [] + getArray (_config >> "itemType");
//_itemType = [["AK_74","weapon"], ["AK_47_M","weapon"], ["M4A1_Aim","weapon"], ["Saiga12K","weapon"], ["RPK_74","weapon"], ["AK_107_kobra","weapon"], ["FN_FAL","weapon"], ["bizon_silenced","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["MakarovSD","weapon"], ["KSVK","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["SVD_CAMO","weapon"], ["DMR","weapon"], ["","military"], ["","medical"], ["MedBox0","object"], ["NVGoggles","weapon"], ["AmmoBoxSmall_556","object"], ["AmmoBoxSmall_762","object"], ["Skin_Camo1_DZ","magazine"], ["Skin_Sniper1_DZ","magazine"], ["DZ_Backpack_EP1","object"]];
//diag_log ("DW_DEBUG: _itemType: " + str(_itemType));
_itemChance = [] + getArray (_config >> "itemChance");
//_itemChance = [0.07, 0.07, 0.05, 0.02, 0.02, 0.02, 0.02, 0.05, 0.05, 0.02, 0.01, 0.02, 0.03, 0.05, 0.01, 0.1, 1, 0.5, 0.1, 0.01, 0.1, 0.1, 0.03, 0.03, 0.03];
//diag_log ("DW_DEBUG: _itemChance: " + str(_itemChance));
//diag_log ("DW_DEBUG: (isnil fnc_buildWeightedArray): " + str(isnil "fnc_buildWeightedArray"));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
//diag_log ("DW_DEBUG: _weights: " + str(_weights));
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
//diag_log ("DW_DEBUG: " + str(count (_itemType)) + " select " + str(_index));
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
};
spawn_Misc_cargo_cont_net2 = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log("DEBUG: Spawning a Misc_cargo_cont_net2 at " + str(_position));
_veh = createVehicle ["Misc_cargo_cont_net2",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
_num = round(random 6) + 5;
_config = configFile >> "CfgBuildingLoot" >> "Industrial";
_itemType = [] + getArray (_config >> "itemType");
//diag_log ("DW_DEBUG: _itemType: " + str(_itemType));
_itemChance = [] + getArray (_config >> "itemChance");
//diag_log ("DW_DEBUG: _itemChance: " + str(_itemChance));
//diag_log ("DW_DEBUG: (isnil fnc_buildWeightedArray): " + str(isnil "fnc_buildWeightedArray"));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
//diag_log ("DW_DEBUG: _weights: " + str(_weights));
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
//diag_log ("DW_DEBUG: " + str(count (_itemType)) + " select " + str(_index));
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder",30];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
};
spawn_Misc_cargo_cont_net3 = {
private["_position","_veh","_num","_config","_itemType","_itemChance","_weights","_index","_iArray"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
if (isDedicated) then {
_position = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
diag_log("DEBUG: Spawning a Misc_cargo_cont_net3 at " + str(_position));
_veh = createVehicle ["Misc_cargo_cont_net3",_position, [], 0, "CAN_COLLIDE"];
//dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
_num = round(random 6) + 3;
_config = configFile >> "CfgBuildingLoot" >> "Military";
_itemType = [] + getArray (_config >> "itemType");
//diag_log ("DW_DEBUG: _itemType: " + str(_itemType));
_itemChance = [] + getArray (_config >> "itemChance");
//diag_log ("DW_DEBUG: _itemChance: " + str(_itemChance));
//diag_log ("DW_DEBUG: (isnil fnc_buildWeightedArray): " + str(isnil "fnc_buildWeightedArray"));
waituntil {!isnil "fnc_buildWeightedArray"};
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
//diag_log ("DW_DEBUG: _weights: " + str(_weights));
for "_x" from 1 to _num do {
//create loot
_index = _weights call BIS_fnc_selectRandom;
sleep 1;
if (count _itemType > _index) then {
//diag_log ("DW_DEBUG: " + str(count (_itemType)) + " select " + str(_index));
_iArray = _itemType select _index;
_iArray set [2,_position];
_iArray set [3,5];
_iArray call spawn_loot;
diag_log("LOOTSPAWN: " + str(_iArray) + " Spawned At A Military Care Package");
_nearby = _position nearObjects ["WeaponHolder",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
};
This gets inserted after the helicrash script.
Once you have that in and save, you need to open your system>server_monitor.sqf. All the way at the bottom, find:
//Spawn crashed helos
for "_x" from 1 to 6 do {
_id = [] spawn spawn_heliCrash;
//waitUntil{scriptDone _id};
};
If you did not already know, this is how many helicrashes will spawn on your server. After that, add:
Code:
//Spawn Misc_cargo_cont_net1
for "_x" from 1 to 6 do {
_id = [] spawn spawn_Misc_cargo_cont_net1;
//waitUntil{scriptDone _id};
};
//Spawn Misc_cargo_cont_net2
for "_x" from 1 to 4 do {
_id = [] spawn spawn_Misc_cargo_cont_net2;
//waitUntil{scriptDone _id};
};
//Spawn Misc_cargo_cont_net3
for "_x" from 1 to 4 do {
_id = [] spawn spawn_Misc_cargo_cont_net3;
//waitUntil{scriptDone _id};
};
Save your file, re-pbo it, and your server should now be spawning care packages!
Find out by reading the arma2oaserver.RPT file, and if you used the code above, that report will be telling you where the care packages are spawning at. It will look like:
Code:
9:27:15 "DEBUG: Spawning a Misc_cargo_cont_net1 at [4439.73,5652.6]"
9:27:15 "DEBUG: Spawning a Misc_cargo_cont_net1 at [6150.82,8862.69]"
9:27:15 "DEBUG: Spawning a Misc_cargo_cont_net1 at [6927.37,9635.6]"
9:27:15 "DEBUG: Spawning a Misc_cargo_cont_net1 at [7709.75,10066.2]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net1 at [8851.32,8559.9]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net1 at [11568.6,7472.14]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net2 at [10107.4,10482.1]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net2 at [4589.17,5770.46]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net2 at [8184.35,5794.95]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net2 at [9620.19,9641.57]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net3 at [4793.86,7343.37]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net3 at [6780.27,7904.9]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net3 at [5129.41,5487.15]"
9:27:16 "DEBUG: Spawning a Misc_cargo_cont_net3 at [10034.1,8499.07]"
And that's it for care packages!