1.7.7.1 custom crash site and infected camp loot

Inkko

Valued Member!
============= 1.7.7.1 Custom Loot Crash Site & Infected Sites ==============
1.7.7.1 Custom Crash Site And Infected Camp Loot
v.1

Ability to customize loot tables and drop chances for infected camps and crash sites. (plus how to adjust spawn rate of crash sites and infected camps.)

Requirements (inc. Tools(must include dowload link)/ Expected Time/Difficulty)

Easy = Blue <10 (If you use my loot table)
Moderate = Orange >10 <30 (If you think up your own loot table it could take longer)

Installation Steps -

Step 1:
Unpack your dayz_server.pbo and locate fn_bases.sqf and server_spawnCrashsite.sqf. These will be the files we will be editing I will be providing the changes you need but will have the loot tables empty for you yourself to fill in. If you do not want to change infected camps skip to step 3.

*At the bottom I will Have the tables I use if you would like to use them*

Step 2:
We will start with infected camps. Open up fn_bases.sqf and look for the chunk of code that looks like this:
Code:
    _lootTable = ["InfectedCamps"] call BIS_fnc_selectRandom;
    _itemTypes =    [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
    _index = dayz_CBLBase  find _lootTable;
    _weights =        dayz_CBLChances select _index;
    _cntWeights = count _weights;

Change the code to look like this:

Code:
    _itemTypes = [];
    _itemChance = [];
    _weights = [];
    _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
    _cntWeights = count _weights;
    _index = _weights call BIS_fnc_selectRandom;

_itemTypes = [[]]; is where you can modify what items will drop. You can call specific weapons, magazines, food, boxes, and other loot tables ect.
Format is '[["What will drop","Type of drop"], ["What will drop","type of drop"]];' What will drop is the name of what you would like to drop and the type of drop will be either a weapon, magazine, or object depending on what you are calling.
EX1: _itemTypes = [["DMR","Weapon"], ["MedBox0","object"]]; // DMR and a medical box would be the only 2 items in the loot table.

_ItemChance=[]; This defines the drop rate going in order with _itemTypes. It is in decimal percent format. '[0.9, 0.02];'
EX1: _ItemChance=[0.2, 0.6]; // DMR would have a .2 drop rate and medbox would have a .6 drop rate.

Step 3:
In this Step we will be changing the crash site loot. It is extremely similar to the infected camps just located in the server_spawnCrashsite.sqf.
Open up your server_spawnCrashsite.sqf and look for the chunk of code the looks like this:
Code:
            _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
            _index = dayz_CBLBase find _lootTable;
            _weights = dayz_CBLChances select _index;
            _cntWeights = count _weights;

Replace the code above with this:
Code:
        _itemTypes = [];
        _itemChance = [];
        _weights = [];
        _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
        _cntWeights = count _weights;
        _index = _weights call BIS_fnc_selectRandom;

as with the infected camps:

_itemTypes = [[]]; is where you can modify what items will drop. You can call specific weapons, magazines, food, boxes, and other loot tables ect.
Format is '[["What will drop","Type of drop"], ["What will drop","type of drop"]];' What will drop is the name of what you would like to drop and the type of drop will be either a weapon, magazine, or object depending on what you are calling.
EX1: _itemTypes = [["DMR","Weapon"], ["MedBox0","object"]]; // DMR and a medical box would be the only 2 items in the loot table.

_ItemChance=[]; This defines the drop rate going in order with _itemTypes. It is in decimal percent format. '[0.9, 0.02];'
EX1: _ItemChance=[0.2, 0.6]; // DMR would have a .2 drop rate and medbox would have a .6 drop rate.

Step 4 (Extra):
To Increase the amount of infected camps that spawn and or increase the frequency of crash sites, you need to edit your server_monitor.sqf located in the system folder of your server pbo.

The default will look like this:
// [_guaranteedLoot, _randomizedLoot, spawnOnStart, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
[3, 4, 3, (40 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;

//Spawn camps
// quantity, marker, radius, min distance between 2 camps
Server_InfectedCamps = [3, "center", 4500, 2000] call fn_bases;
dayzInfectedCamps = Server_InfectedCamps;
publicVariable "dayzInfectedCamps";

to increase the frequency of the crashsites change this (40) number to a lower value which will make the crash spawner trigger on a shorter timer. Changing this (0.75) value will change the chance of a crash site spawning when the spawn timer is triggered. Changing the (3) number will change how many crashsites spawn on the start of the server.

[3, 4, 3, (40 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;

To increase the number of infected camps that spawn on the start of the server change this (3) to any number you desire.

Server_InfectedCamps = [3, "center", 4500, 2000] call fn_bases;

Not sure if anyone has any guides for doing it this way in 1.7.7.1 so I threw up a quick guide on how to do it. I'm fairly certain no one has done the infected camps this way yet.

FAQ - Always make backups!

Credits - I've been using this workaround for the past couple patches when the loot cfg was implemented. Never really found anyone who did it like me so who knows.

My Loot Table:

Infected Camps:
Code:
    _itemTypes = [["M14_EP1", "weapon"], ["DMR", "weapon"], ["Sa58P_EP1", "weapon"], ["Sa58V_CCO_EP1", "weapon"], ["Sa58V_EP1", "weapon"], ["Sa58V_RCO_EP1", "weapon"], ["G36A_camo", "weapon"], ["MP5A5", "weapon"], ["Mk_48_DZ", "weapon"], ["SVD_CAMO", "weapon"], ["M4A1_AIM_SD_camo", "weapon"], ["M16A2GL", "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.01, 0.01, 0.05, 0.05, 0.05, 0.05, 0.04, 0.04, 0.02, 0.01, 0.05, 0.05, 0.08, 0.03, 0.02, 0.05, 0.05, 0.03, 0.02, 0.02];
    _weights = [];
    _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
    _cntWeights = count _weights;
    _index = _weights call BIS_fnc_selectRandom;

Crashsites:
Code:
      _itemTypes = [["M14_EP1", "weapon"], ["DMR", "weapon"], ["Sa58P_EP1", "weapon"], ["Sa58V_CCO_EP1", "weapon"], ["Sa58V_EP1", "weapon"], ["Sa58V_RCO_EP1", "weapon"], ["G36A_camo", "weapon"], ["MP5A5", "weapon"], ["Mk_48_DZ", "weapon"], ["SVD_CAMO", "weapon"], ["M4A1_AIM_SD_camo", "weapon"], ["M16A2GL", "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.01, 0.01, 0.05, 0.05, 0.05, 0.05, 0.04, 0.04, 0.02, 0.01, 0.05, 0.05, 0.08, 0.03, 0.02, 0.05, 0.05, 0.03, 0.02, 0.02];
        _weights = [];
        _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
        _cntWeights = count _weights;
        _index = _weights call BIS_fnc_selectRandom;

https://www.dropbox.com/sh/fvj5fqarn1lgsvh/faqnPkvQAy


============= 1.7.7.1 Custom Loot Crash Site & Infected Sites ==============

With DayZ 1.8 I was getting a zero divisor error trying to modify the crash sites. I'm using the server_spawnCrashSite.sqf from 1.7.7.1 and it seems to be working just fine for custom crash site loot on DayZ 1.8.
 
Back
Top