[Tutorial] Editing Heli Crashes - 1.7.6.1 (Simplified)

Editing Heli-Crash Loot - 1.7.6.1
By: Unkinhead
Credits: Inkko




Unpack your server.pbo with PBOview (or another PBO unpacker)






Open server_spawnCrashSite.sqf and look for this chunk of code.






Code:
_num        = round(random _randomizedLoot) + _guaranteedLoot;
 
_config =        configFile >> "CfgBuildingLoot" >> _lootTable;
_itemTypes =    [] + getArray (_config >> "itemType");
_index =        dayz_CBLBase  find "HeliCrash";
_weights =        dayz_CBLChances select _index;
_cntWeights = count _weights;



Replace it with:





Code:
_num        = round(random 4) + 4;
 
        _config = configFile >> "CfgBuildingLoot" >> _lootTable;
        _itemTypes = [["SCAR_H_LNG_Sniper", "weapon"], ["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["G36_C_SD_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58P_EP1","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"]];
        _itemChance = [0.01, 0.02, 0.05, 0.01, 0.03, 0.05, 0.01, 0.06, 0.03, 0.02, 0.01, 0.01, 0.02, 0.02, 0.9, 0.09, 0.01, 0.5, 0.05, 0.05, 0.01, 0.05, 0.05, 0.04, 0.03, 0.05, 0.05, 0.05, 0.04, 0.05];
        _weights = [];
        _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
        _cntWeights = count _weights;
        _index = _weights call BIS_fnc_selectRandom;



Then, find this portion:





Code:
//Crash loot - just uncomment the one you wish to use by default with 50cals is enabled.
    //Table including 50 cals
    _lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom;
    //Table without 50 cals
    //_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;




And replace it with:




Code:
//Crash loot - just uncomment the one you wish to use by default with 50cals is enabled.
    //Table including 50 cals
    _lootTable = ["Military"] call BIS_fnc_selectRandom;
    //Table without 50 cals
    //_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;



EDITING:​



Change this line accordingly to your liking:






Code:
_num = round(random 4) + 4;



This means that a random number up to 4, + 4 will be the amount of loot that drops.



You can change either number to your liking. (EX: _num = round(random 2) + 3; means that a heli crash will have up to 2 random loot drops, and 3 indefinitely.



And the real editing with loot customization:



Code:
_itemTypes = []



and



Code:
_itemChance = []



I have already filled them in to give you an idea of how it is inserted, but essentially, for itemTypes =, you just need to insert the class name that you want to spawn, and then correspond that with the itemChance = (decimal value). MAKE SURE, that you have itemTypes and itemChance match in regarding to order, EX:




_itemTypes = [["SCAR_H_LNG_Sniper", "weapon"]];​



_itemChance = [0.01];​






The above will then connect to eachother because they are aligned correctly...To put it simply: First item in itemTypes uses the first item in itemChance.





ALSO, make sure that when adding a itemtype + itemchance you DON'T put a comma on the last item in the each list (itemTypes + itemChance) --- This also means adding a comma to the second last thing on the list when adding a new one.



When your done customizing repack with pboview and upload! you're done!






Also, this should help for getting class names :) --- http://dayzsuperhive.co.uk/object-library.html
 
Open server_monitor.sqf as mentioned above. At the bottom find:
Code:
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [4, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;
You want to change the _frequency value.
The default above checks every 50 minutes (give or take 15 minutes from _variance) with a 75% chance to spawn.

If you wanted it to say spawn one exactly every 30 minutes every time you would change the code to this:
Code:
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [4, 4, (30 * 60), (0 *1), 1, 'center', 4000, true, false] spawn server_spawnCrashSite;
For one every hour it would look like this:
Code:
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [4, 4, (60 * 60), (0 *1), 1, 'center', 4000, true, false] spawn server_spawnCrashSite;
 
Hey

I tried your guide like a thousand times but it never really worked for me :l
During 12 hours only 3 crash sites spawned...

I followed your instructions exactly, see:
Code:
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [4, 5, (1 * 60), (0 * 1), 0.99, 'center', 4000, true, false] spawn server_spawnCrashSite;
Maybe my file is wrong, I have a bliss server and edited the "server_monitor.sqf" inside the dayz_server.pbo, which is inside my @bliss_1.chernarus folder
 
the code in your post would have one spawn every 60 seconds with a 99% chance.. try something more reasonable like 10 minutes or something.. on my server i use
Code:
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
  nul = [5, 4, (24 * 60), (0 * 1), 1, 'center', 4000, true, false] spawn server_spawnCrashSite;
and have confirmed that one spawns every 24 minutes
 

dagg929

Well-Known Member
Getting an error in the RPT loading this after I made a few changes.

Error pertains to this line:
_itemTypes = [["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"], ["M60A4_EP1", "weapon"], ["MG36", "weapon"], ["M40A3","weapon"], ["M240_DZ","weapon"], ["M4A1_HWS_GL_SD_Camo", "weapon"], ["M4A3_CCO_EP1","weapon"], ["M107_DZ","weapon"], [“BAF_AS50_scoped”,”weapon”], ["bizon_silenced",”weapon”]];
_itemChance = [0.1, 0.06, 0.01, 0.03, 0.05, 0.07, 0.04, 0.04, 0.03, 0.04, 0.02, 0.7, 0.15, 0.25, 0.25, 0.04, 0.01, 0.02, 0.04, 0.05, 0.06, 0.06, 0.06, 0.05, 0.01, 0.06, 0.04, 0.01, 0.04, 0.05, 0.02, 0.01, 0.12];


Anyone see anything wrong with this? I can't seem to find anything.
 
Getting an error in the RPT loading this after I made a few changes.

Error pertains to this line:
_itemTypes = [["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"], ["M60A4_EP1", "weapon"], ["MG36", "weapon"], ["M40A3","weapon"], ["M240_DZ","weapon"], ["M4A1_HWS_GL_SD_Camo", "weapon"], ["M4A3_CCO_EP1","weapon"], ["M107_DZ","weapon"], [“BAF_AS50_scoped”,”weapon”], ["bizon_silenced",”weapon”]];
_itemChance = [0.1, 0.06, 0.01, 0.03, 0.05, 0.07, 0.04, 0.04, 0.03, 0.04, 0.02, 0.7, 0.15, 0.25, 0.25, 0.04, 0.01, 0.02, 0.04, 0.05, 0.06, 0.06, 0.06, 0.05, 0.01, 0.06, 0.04, 0.01, 0.04, 0.05, 0.02, 0.01, 0.12];


Anyone see anything wrong with this? I can't seem to find anything.
Hm weird... Looks fine to me, mind posting the excerpt from your RPT? including the lines above and below it?

EDIT: I believe "M107_DZ" should be "M107" could be wrong though...Can anyone confirm?
 
I just edited my settings to spawn a crash site every 60 seconds because I just wanted to see if heli crashes are able to spawn...
Will load in a longer time and see if it works ;)

But just to know: The file is inside the @bliss.chernarus folder, isnt it?
 

Crimes

New Member
Getting an error in the RPT loading this after I made a few changes.

Error pertains to this line:
_itemTypes = [["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"], ["M60A4_EP1", "weapon"], ["MG36", "weapon"], ["M40A3","weapon"], ["M240_DZ","weapon"], ["M4A1_HWS_GL_SD_Camo", "weapon"], ["M4A3_CCO_EP1","weapon"], ["M107_DZ","weapon"], [“BAF_AS50_scoped”,”weapon”], ["bizon_silenced",”weapon”]];
_itemChance = [0.1, 0.06, 0.01, 0.03, 0.05, 0.07, 0.04, 0.04, 0.03, 0.04, 0.02, 0.7, 0.15, 0.25, 0.25, 0.04, 0.01, 0.02, 0.04, 0.05, 0.06, 0.06, 0.06, 0.05, 0.01, 0.06, 0.04, 0.01, 0.04, 0.05, 0.02, 0.01, 0.12];


Anyone see anything wrong with this? I can't seem to find anything.
Use the quotations right with the Bizon and As50, the last one in your line. They seem different than the normal " "
 
I just edited my settings to spawn a crash site every 60 seconds because I just wanted to see if heli crashes are able to spawn...
Will load in a longer time and see if it works ;)

But just to know: The file is inside the @bliss.chernarus folder, isnt it?
Yes that is the correct file.
 
Quick question, I am trying to make sure that NV goggles are on the helicopter loot table, (I have a day/night server). I also wish to add the range finder to the loot table. How do I add the range finder (ie what is the second part,

[
"binocular_vector
"
," ????"]
just need the ???? area. Also since I have a custom loot table will I need to manually add in the NV goggles? Also is it possible to remove the Nato Rounds for the AS50 since I have removed that from the loot table?

Here is my loot table
_num = round(random 4) + 4;

_config = configFile >> "CfgBuildingLoot" >> _lootTable;
_itemTypes = [["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58P_EP1","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"], ["M107_DZ","weapon"], ["bizon_silenced","weapon"], ["M40A3","weapon"]];
_itemChance = [0.02, 0.05, 0.01, 0.03, 0.05, 0.01, 0.06, 0.03, 0.02, 0.02, 0.9, 0.09, 0.01, 0.5, 0.05, 0.05, 0.01, 0.05, 0.05, 0.04, 0.03, 0.05, 0.05, 0.05, 0.04, 0.05, .02, .12, .04];
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
_cntWeights = count _weights;
_index = _weights call BIS_fnc_selectRandom;
 

Crimes

New Member
["Binocular_Vector", "military"]
Thanks, will try it out also when i get home from work..:mad:
Maybe a dumb question, but does it matter how you script it, for instance: ["Binocular_Vector","military"] or ["Binocular_Vector", "military"] ?? It's just one spacebar after the , Does it matter? I'm seeing variations in each script posted, some have a spacebar between it and some not.
 
Thanks, will try it out also when i get home from work..:mad:
Maybe a dumb question, but does it matter how you script it, for instance: ["Binocular_Vector","military"] or ["Binocular_Vector", "military"] ?? It's just one spacebar after the , Does it matter? I'm seeing variations in each script posted, some have a spacebar between it and some not.
Nope, it shouldn't matter, as far as i know .sqf's aren't type-strict
 
Top