1.7.6.1 heli crash site loot

Inkko

Valued Member!
I have figured out how to cusomize loot spawns for crash sites on 1.7.6.1
I made these changes on chernarus. My host is dayz.st
--dayz_server.pbo--
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;

I then changed it to look like this
Code:
              _num= round(random 4) + 5;
 
              _config = configFile >> "CfgBuildingLoot" >> _lootTable;
              _itemTypes = [["SCAR_H_LNG_Sniper", "weapon"], ["SCAR_H_LNG_Sniper_SD", "weapon"], ["SCAR_L_STD_Mk4CQT", "weapon"], ["SCAR_L_CQC_EGLM_Holo", "weapon"], ["SCAR_L_STD_EGLM_RCO", "weapon"], ["SCAR_H_Base", "weapon"], ["SCAR_H_STD_EGLM_Spect", "weapon"], ["AKS_74_UN_kobra", "weapon"], ["m8_base", "weapon"], ["m8_carbineGL", "weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["BAF_AS50_TWS", "weapon"], ["PMC_AS50_scoped", "weapon"], ["PMC_AS50_TWS", "weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"]];
              _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.05, 0.05, 0.9, 0.09, 0.05, 0.5, 0.05, 0.05, 0.05, 0.05];
              _weights = [];
              _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
              _cntWeights = count _weights;
              _index = _weights call BIS_fnc_selectRandom;

Now I will explain some things you can change to customize the loot.
Code:
_num = round(random 4) + 5;
This means that a random number up to 4, + 5 will be the amount of loot that drops.
You can change either number to your liking.

Code:
_itemTypes = [];
This is the array setup for what loot will drop. I added examples above to make it easier to see how to properly input them.

Code:
_itemChance = [];
This is the chance the _itemTypes has of dropping. I believe it is a decimal percent. It goes in order with _itemTypes.

Someone pointed out that I had an error from when I copied and pasted between my file and the browser but I have fixed that now.
 
I noticed this part
Code:
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;

It should be _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
but when I tested it this way it seemed to make the loot spawn variety not as good. Not sure why but it works either way and I found the way I did it better for variety on what drops.
 
Well when you have a host that doesn't give you access to that, you get my work-around lol.
 
Sometimes when I modify the custom loot tables, helicopters either A) Don't spawn at all B)Spawn with NO loot...

any ideas as to why?

PS-It's a Panthera server

_num= round(random 5) + 5;

_config =configFile >> "CfgBuildingLoot" >> "HeliCrash";
_itemTypes =[["AKS_74_UN_kobra", "weapon"], ["m8_carbineGL", "weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["PMC_AS50_scoped", "weapon"], ["", "military"], ["MedBox0", "object"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["G36_C_SD_camo", "weapon"]];
_itemChance = [0.9, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05];
 
Back
Top