100% Custom Loot tables - TUTORIAL

You would not be overriding anything other than the stock spawn_loot.sqf found in the DayZ Code.pbo compiles folder. As Seven has mentioned elsewhere in this thread, you would be creating a new array of the same objects - in this case from the cfgLoot.hpp also found in the same .pbo file. - and switching the ones you modify with the default from that .hpp file with functions - in this case - from spawn_loot.sqf. You'd then override the default spawn_loot.sqf with the custom one you created by initiating it through the server mission init.sqf as Seven did with his custom loot tables.
 
Hello everyone - this is what I'm currently toying around with (I'm on celle, your set up may vary slightly iunno)

init->my own compile->my own building_spawnloot.sqf, spawn_loot.sqf

Top of my description.ext ->
#include "cfgbuildingloot.hpp"
#include "cfgLoot.hpp"


Do not forget the following:

in the building_spawnloot.sqf change this:

_config = configFile >> "CfgBuildingLoot" >> _type;

to this:

_config = missionConfigFile >> "CfgBuildingLoot" >> _type;

and in spawn_loot.sqf change this:

_itemTypes = [] + ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);

to this:

_itemTypes = [] + ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0);

Basically configFile -> missionConfigFile is the change being made in these 2 files.

In the mission folder throw in the cfgbuildingloot.hpp and cfgloot.hpp and make all those loot pile or building loot edits you need!

NOTE: Back up all your shit - Cuz well, I haven't fully tested all this yet - But I'm pretty sure it'll work from what I've done so far.

Tell me how it all turns out for you guys!

EDIT: A few things are still being sorted out. Celle is a bit funky and didn't give this a go on chern, so if anyone wants to try it and tell me how it turns out
 
Wait. I didn't really understand, what i have to enter there :/
Also in the Desciption.ext and init :/
can you explain it?
and which spawn_loot.sqf ?
where did i get it ?
 
Manatee Thats a fantastic solution, I'll look more into this for the next version when 1.7.7 launches, will reduce the amount of changes needed.
 
I want to reduce the amount of food spawning in buildings. It works fine for the supermarket since there is " ["","food"], " but it is still spawning in the residential and military buildings although there is no ["","food"], in the classes.
 
I want to reduce the amount of food spawning in buildings. It works fine for the supermarket since there is " ["","food"], " but it is still spawning in the residential and military buildings although there is no ["","food"], in the classes.

That is because if you look in the cfgLoot.hpp the classes Civilian, Generic, Military and Hunter all contain food and/or drink of some kind as well.
 
How Custom new Building spawn Loot?;)

English is not very good:oops:

Code:
_config =              configFile >> "CfgBuildingLoot" >> _type;
_positions =    [] + getArray (_config >> "lootPos");
//_itemTypes =  [] + getArray (_config >> "itemType"); // Default System
_lootChance =  getNumber (_config >> "lootChance");
 
//------------------//
//CUSTOM LOOT SPAWNS//
//------------------//
_itemTypes = []; //Initialise array
_itemChance = []; //Initialise array
 
switch (_type) do { //Assign building classes
        case "Land_HouseV_1I4": { _LootClass = "Residential"; };
        case "Land_kulna": { _LootClass = "Residential"; };
        case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
        case "Land_hut06": { _LootClass = "Residential"; };
        case "Land_Hlidac_budka": { _LootClass = "Residential"; };
        case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
        case "Land_A_Pub_01": { _LootClass = "Residential"; };
        case "Land_Shed_wooden": { _LootClass = "Residential"; };
        case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
        case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
        case "Land_ruin_01": { _LootClass = "Residential"; };
        case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
        case "Land_HouseV2_01A": { _LootClass = "Residential"; };
        case "Land_psi_bouda": { _LootClass = "Residential"; };
        case "Land_KBud": { _LootClass = "Residential"; };
        case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
        case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
        case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
        case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
        case "Land_Church_01": { _LootClass = "Residential"; };
        case "Land_Church_03": { _LootClass = "Residential"; };
        case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
        case "Land_Panelak": { _LootClass = "Residential"; };
        case "Land_Panelak2": { _LootClass = "Residential"; };
        case "Land_rail_station_big": { _LootClass = "Residential"; };
        case "Land_A_Office01": { _LootClass = "Residential"; };
        case "Land_A_Office02": { _LootClass = "Residential"; };
        case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
        case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
        case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
        case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
        case "Land_Hangar_2": { _LootClass = "Industrial"; };
        case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
        case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
        case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
        case "Land_Shed_W01": { _LootClass = "Industrial"; };
        case "Land_Tovarna2": { _LootClass = "Industrial"; };
        case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
        case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
        case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
        case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
        case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
        case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
        case "Land_wagon_box": { _LootClass = "Industrial"; };
        case "Land_Rail_House_01": { _LootClass = "Industrial"; };
        case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
        case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
        case "Land_A_Hospital": { _LootClass = "Hospital"; };
        case "MASH": { _LootClass = "Hospital"; };
        case "MASH_EP1": { _LootClass = "Hospital"; };
        case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
        case "Land_a_stationhouse": { _LootClass = "Military"; };
        case "Land_Mil_ControlTower": { _LootClass = "Military"; };
        case "Land_SS_hangar": { _LootClass = "Military"; };
        case "Land_Mil_House": { _LootClass = "Military"; };
        case "Camp": { _LootClass = "Military"; };
        case "CampEast": { _LootClass = "Military"; };
        case "CampEast_EP1": { _LootClass = "Military"; };
        case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; };
        case "Land_A_Villa_EP1": { _LootClass = "MilitarySpecial"; _positions = [[-23.3442,1.71484,-3.65929],[14.5498,-5.69775,-5.06722],[5.8457,-2.09814,-5.06717],[9.5249,3.76563,-5.06717],[10.0454,11.5093,-5.0734],[0.268555,8.64648,-5.06699],[-0.378906,15.3989,-5.06724],[-6.68506,14.9448,-5.06722],[-10.9644,13.0996,-5.06719],[11.0571,4.48926,-1.48401],[2.85938,9.12939,-1.48407],[-3.87646,8.01416,-1.4844],[0.0537109,10.3984,-1.4844],[-2.78467,13.5903,-1.4844],[-0.118652,15.3394,-1.4844],[-6.73779,15.772,-1.4844],[-8.39453,13.5249,-1.4844],[-10.5317,9.75146,-1.4844],[-11.8062,14.2358,-1.4844],[-15.5771,14.0396,-1.4844]]; };
        case "Land_Misc_deerstand": { _LootClass = "Hunting"; };
        case "Land_stodola_old_open": { _LootClass = "Farm"; };
        case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
        case "Land_stodola_open": { _LootClass = "Farm"; };
        case "Land_Barn_W_01": { _LootClass = "Farm"; };
        case "Land_Barn_W_02": { _LootClass = "Farm"; };
        default { _LootClass = "Residential"; };
};
 
That is because if you look in the cfgLoot.hpp the classes Civilian, Generic, Military and Hunter all contain food and/or drink of some kind as well.


is it enough to change the values and recompile or do i have to make a new file like the other "fixes" loot table ?
 
I want to spawn ItemWaterBottle more but don't want to spawn Soda plenty.
So I added ["ItemWaterBottle","generic"] to case "Supermarket" and change _itemchance of ["" ,"generic"] to 0.01
But error displayed ingame.
Then added ["ItemWaterBottle","object"] .But It doesn't seem to spawn rightly( the itemchance is 0.3)
Some help would be great thanks.
 
So, i've been working on a custom spawn_loot.sqf, that should allow me to customize the loot-piles, but i don't quite know what modifications to make, i used the building_spawnloot.sqf from this tutorial, but i just can't get it working, could someone tell me what im doing wrong?
http://bit.ly/YHk3nf <-----my spawn_loot.sqf
 
Hello everyone - this is what I'm currently toying around with (I'm on celle, your set up may vary slightly iunno)

init->my own compile->my own building_spawnloot.sqf, spawn_loot.sqf

Top of my description.ext ->
#include "cfgbuildingloot.hpp"
#include "cfgLoot.hpp"


[yadda yadda yadda]

did you made that actually work?
 
did you made that actually work?

I can confirm Manatee Hunter's method does work, I got the loot piles in cfgloot.hpp to spawn.

I changed them all to highly rare mags such as as50 and m107 etc and they all spawned nicely in piles.

I use the OP (SEVEN) method for normal loot and Manatee's method for the piles
 
chernarus, well at least i got it to work on taviana with the method by seven ... plus spawnloot.sqf addon

had the problem that nothing spawned at first, because of one fucking little comma >.< ... now it works yay
 
Back
Top