100% Custom Loot tables - TUTORIAL

If I added this just to remove trash from certain places and replace with something else. Would all the other default loot still spawn?

 
Yes if you remove items, the only items effected will be the ones you remove. but removing trash loot will change chances of all loot drastically.
 
I am still having an issue with 7 tents overtime spawning in the supermarket. Following is an excerpt from my file.

case "Supermarket": {
_itemTypes = [
//["ItemWatch","generic"],
//["ItemCompass","generic"],
["ItemMap","weapon"],
["Makarov","weapon"],
["Colt1911","weapon"],
//["ItemFlashlight","generic"],
["ItemKnife","generic"],
["ItemMatchbox","generic"],
["","generic"],
["LeeEnfield","weapon"],
["revolver_EP1","weapon"],
//["DZ_Assault_Pack_EP1","object"], // 12
//["DZ_Czech_Vest_Puch","object"], // 12-0
["DZ_ALICE_Pack_EP1","object"], // 16
["DZ_TK_Assault_Pack_EP1","object"], // 16
["DZ_British_ACU","object"], // 18
["Winchester1866","weapon"],
["WeaponHolder_ItemTent","object"],
["","food"],
["","trash"],
["Crossbow_DZ","weapon"],
["Binocular","weapon"],
//["PartWoodPile","magazine"],
["MR43","weapon"]
];
_itemChance = [
//0.15, //watch
//0.01, //compass
0.05,
0.02,
0.02,
//0.05, //flashlight
0.02,
0.05,
0.01,
0.01,
0.01,
//0.05, //12
//0.04, // 12-0
0.02, //16
0.02, //16
0.01, //18
0.01,
0.08,
0.3,
0.15, //org .2
0.01,
0.05,
//0.02,
0.01




I take it that removing the backpacks, flashlights, etc and lowering the trash loot is adding to the amount of tents?
 
You have managed to change your tents drop chance to 0.08 which is even higher than a maps spawn chance, Tents default at 0.01.
 
okay thanks!, I ment I was only going to remove trash from certain areas not every building and replace with something else, would that work dude?

 
you can't do it to a specific building in a town, but you can do it for all of one type of building, you would just need to copy its base class and change that building to the new base class with the changed loot tables.
 
I wonder - you're skipping the config.cpp from the dayz_code.pbo by doing this (in essence).

Do you think it would be possible to also skip the banlist found in dayz_anim.pbo by writing something simularly into the mission.pbo? Like pass it an array of "allowed" weapons that superseeds the dayz_anim.pbo??
 
No. This skips an array (list) collection.
During game launch it compiles the data form the config files to build entities that the game uses. These entities need to be generated on start up and cannot be manipulated afterwards due to being generated by the engine not the virtual machine that runs the server and client code.
The "banning" process generates a null entity and then recompiles these entities as the null object so they appear to not work. The entities are in the game, they just don't have any attributes to them anymore.
 
No. This skips an array (list) collection.
During game launch it compiles the data form the config files to build entities that the game uses. These entities need to be generated on start up and cannot be manipulated afterwards due to being generated by the engine not the virtual machine that runs the server and client code.
The "banning" process generates a null entity and then recompiles these entities as the null object so they appear to not work. The entities are in the game, they just don't have any attributes to them anymore.


Can i make a new case in building_spawnloot?

Because i wanted to modify helicrash loot with this, and i noticed that a weapon i have spawning in the barracks (militaryspecial) spawned at a heli crash. This is because heli crash pulls from: _lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;

could i simply just create a new case called "HeliCrashCustom" And insert my own arrays? and then edit

_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;

to

_lootTable = ["HeliCrashCustom"] call BIS_fnc_selectRandom;

Or will no changes work? IE has to be done via mission overriding.

------------------

If the answer is no i cant change it, then i would love to see that heli crash loot tutorial you proposed in the faq :)
 
Unkinhead - it should work. My helicrashes call a custom loot table for generic items - but that table is inside dayz_code.pbo.

A few instances of dayz ago, all the helicrash droptable information was DIRECTLY in the server.pbo - it was one of the few things you could alter server side that affected all the players without a custom download. There's no reason you couldn't take out the cross reference array _lootTable = refererence and just BUILD the loot arrays right there.
 
Unkinhead - it should work. My helicrashes call a custom loot table for generic items - but that table is inside dayz_code.pbo.

A few instances of dayz ago, all the helicrash droptable information was DIRECTLY in the server.pbo - it was one of the few things you could alter server side that affected all the players without a custom download. There's no reason you couldn't take out the cross reference array _lootTable = refererence and just BUILD the loot arrays right there.

Yea i actually got it working, unfortuantely im almost positive dayz 1.7.6.1 fucked up the heli crash code.

Like the default crash, weapons i insert (some of them) are spawning in gratituous amounts for no reason. Just like the svd_camo and m24 do on the default crash. I have a scar at 0.01 value, and i find 4 of them on 1 crash.
 
Crash sites are not effected by this code, you must make the changes to the server_spawnCrashSite.sqf code using the same principle as this edit to make changes.
 
Since no one could find a Machete on my server I've looked at the file just to be sure:
And on line 200, in the Farm class we have:

Code:
["WeaponHolder_ItemMachete"]

And in the hunting Class there's

Code:
["WeaponHolder_ItemMachete", "object"]

The default config.cpp is the same. o_O
Typo? Or this is the way it should be? If so, what's the difference?
 
best change it to
Code:
["WeaponHolder_ItemMachete", "object"]
spawn_loot.sqf uses the class to decide how to spawn the loot. "object" will just spawn the object as a single item, with nothing defined as the class it will try to spawn random junk around the object which will cause bother trying to pick the machete up. I will update the code now with this change.
 
This method of using the 'fixes' folder to over-ride dayz code is interesting. Does this apply to paa graphic files too?

I'd love to alter the large advertising notice boards in the game. :)
 
no you cannot overwrite texture files. Arma packages is files based of a header location defined in the pbo. Most textures are defined with their residing package.
"ca\modelname\data"
"ca\buildings\data"
"ca\plants\data"
 
I received a PM about adding extra buildings that aren't already predefined in the existing config files. This needs some extra work. You will need to find positions you require your buildings to spawn loot in their local coordinates and add them in manually to new case statements of the original code.

Here is a copy and paste from my reply to this user:


in the switch(_type) section:
Code:
switch (_type) do {
    case "Land_HouseV_1I4": { _LootClass = "Residential"; };
    case "Land_kulna": { _LootClass = "Residential"; };
    case "Land_Ind_Workshop01_04": { _LootClass = "Residential"; };
};
You can easily add positions. Just add a new case and the extra _positions variable.
Code:
case "Land_mYcustombuilding": { _LootClass = "MilitarySpecial"; _positions = [[0.1,-1.9,-2.21],[0.2,-0.45,-1.56]]; };

Actually getting these coordinates will be the challenge, I know there is a code floating about somewhere that makes it easy to get the coordinates but I'm not to sure where to find it.
 
For case hunting for example, "","military" would do a random item classified as military.
Would this still spawn military weapons in there or no?
What would ["","hunter"] do considering nothing is under a table called this?


As well, what purpose does the helicrash code in here serve if it does not effect helicopter crashes?
 
Back
Top