narsil
New Member
Hi, we are currently attempting to alter the heli crash site loot tables. we have;
1) downloaded our server.pbo file and extracted the PBO with cpbo.exe.
2) edited the server_functions.sqf file to change the heli crash code.
3) repacked as a PBO using (cpbo.exe again).
4) using FTP I have then overwritten the original server.pbo file (while the server was offline) and then restarted the server.
After that I believe it should be functioning, but all I get is people hanging at loading. The code I have out in place is this:
I believe this is all correct, and that the weapons I have specified are fine to use. If someone could advise me I would be very grateful.
Is there any bad line of code, or maybe a bad step in packing the .pbo file?
Thanks in advance.
1) downloaded our server.pbo file and extracted the PBO with cpbo.exe.
2) edited the server_functions.sqf file to change the heli crash code.
3) repacked as a PBO using (cpbo.exe again).
4) using FTP I have then overwritten the original server.pbo file (while the server was offline) and then restarted the server.
After that I believe it should be functioning, but all I get is people hanging at loading. The code I have out in place is this:
spawn_heliCrash = {
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 crashed helicopter at " + str(_position));
_veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
dayzFire = [_veh,2,time,false,false];
publicVariable "dayzFire";
if (isServer) then {
nul=dayzFire spawn BIS_Effects_Burn;
};
_num = round(random 6) + 3;
//_itemType = [] + getArray (_config >> "itemType");
//_itemChance = [] + getArray (_config >> "itemChance");
_itemType = [["m107_DZ","weapon"], ["BAF_LRR_scoped","weapon"], ["G36_c_SD_eotech","weapon"], ["BAF_L110A1_Aim","weapon"], ["Saiga12K","weapon"], ["RPK_74","weapon"], ["AK_107_kobra","weapon"], ["FN_FAL","weapon"], ["bizon_silenced","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["BAF_L85A2_RIS_ACOG","weapon"], ["M40A3","weapon"], ["Mk_48_DZ","weapon"], ["M249","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"]];
_itemChance = [0.02, 0.03, 0.05, 0.04, 0.02, 0.03, 0.04, 0.02, 0.05, 0.04, 0.01, 0.05, 0.04, 0.03, 0.04, 0.02, 0.08, 1, 0.5, 0.07, 0.03, 0.09, 0.1, 0.02, 0.03, 0.05];
//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",20];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
};
};
I believe this is all correct, and that the weapons I have specified are fine to use. If someone could advise me I would be very grateful.
Is there any bad line of code, or maybe a bad step in packing the .pbo file?
Thanks in advance.