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.
I then changed it to look like this
Now I will explain some things you can change to customize the loot.
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.
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.
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 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;
You can change either number to your liking.
Code:
_itemTypes = [];
Code:
_itemChance = [];
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.