100% Custom Loot tables - TUTORIAL

Apologies for the triple post.

Seven,

I have been going over and over my attempted conversion of your custom loot tables to Taviana, but cannot get it to work. I had noticed that there are two loot classes you did not define in your original code: "Church" and "Office", and that you substituted "Residential" for the buildings on Chernarus that use those two loot classes. So that is not the problem with my conversion.

Back to the drawing board
 
the reason behind the substitute is because the default code rips the tables for church and office from residential
Code:
class Office: Residential
class Church: Residential
 
From my experimentation with this on Chernarus, when you add a weapon or item to a loot type - such as Farm, Hunting, Military, etc - that added item will spawn in all buildings that that type of loot is associated with.
 
If I did this can I just customize one building or do I have to customize everyone?
Loot is spawned based of the buildings loot type. so all Barns go under the Farm class. If you change the farm class anything under farm will change.
You can however add more classes and assign all of the same building to this new class. But you cannot make a single specific building spawn certain loot.
 
Im going to assume that Seven's loot spawn files only work with the most recent dayz version? I understand that the other maps do not run the up to date Dayz code so soon when they update to Taviana 3.0 it will work?
 
Is it possible to add weapons you can manuly spwan to this loot table? like SCAR_H_STD_EGLM_Spect?

And is there a reason why for example NV googles and G36 are commented out?

whats this? ["Body","object"],

and is it possible to change itemtypes? for example hospital to single items?
 
Seven can answer your questions better than me, as he wrote the code. However, I did experiment with his loot tables on Chernarus. The weapons I was able to add included the AA-12 (have to comment out a line in BE scripts.txt), SCAR_H_LNG_Sniper, SVD_NSPU_EP1, AKS_74_GOSHAWK, and AKS_74_NSPU ... to name a few. Also, this was using rMod. Nothing from the M8 family would work for me; nor the black G36 Eotech. I was also able to add ammo for the AA12.
 
I've finally adapted Seven's Custom Loot Tables for another map - for Taviana 2.0 (.com). Here is the code you need:http://pastebin.com/UFB4BcT2

To implement this on your Taviana 2.0 server, follow steps 1-5 of Seven's tutorial in the first post on the first page of this thread. Then:

Find this line in your server mission PBO init.sqf file (which you've opened with Notepad++)

Code:
call compile preprocessFileLineNumbers "\kh\dayztaviana\init\compiles.sqf"; //Compile regular functions

Add directly after the above, this:

Code:
building_spawnLoot = compile preprocessFileLineNumbers "fixes\building_spawnLoot.sqf";

Now repack your server mission PBO and upload it back to your server. That's it.
 
Found a typo/wrong class in the default file.
Line 21.
Code:
        case "Land_Ind_Workshop01_04": { _LootClass = "Residential"; };
This should spawn Intrustrial items so:
Code:
        case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };

config.cpp

Code:
    class Land_Ind_Workshop01_04: Industrial {
        lootPos[] = {{-1.37415,4.18896,-1.53123},{0.695435,4.24561,-1.52934},{-1.06677,2.69531,-1.53062},{0.79248,-4.60742,-1.49341},{-1.84424,-6.1709,-1.44427},{-1.05566,-4.08398,-1.51927},{1.43774,-6.59424,-1.41742}};
        hangPos[] = {{-0.541748,4.01221,-2.03068}};
    };
 
Any idea with the next dayz update, where new loot tables are being added, it will render this broken? I understand that adding another loot table to this code is easy, but will the custom code you wrote not work in some way?
 
That depends on what the loot tables for Taviana 3.0 look like, but surely they will be different as they will contain 1.7.6.1 items and weapons. Also, more buildings may get added in the update but without a doubt, I plan to update what I have already done for Taviana 3.0 when it comes out.
 
I have patched the file for the "Land_Ind_Workshop01_04" fix.

@Saethkept I noticed in your file you don't have any of tavi's extra buildings in the initial definition Switch, You may want to add them or they will default to residential.
 
Im going to assume that Seven's loot spawn files only work with the most recent dayz version? I understand that the other maps do not run the up to date Dayz code so soon when they update to Taviana 3.0 it will work?

This code will work with any dayz version. The style of loot spawning is based on dated code that doesn't break anything with the new loot spawning code. It was more convenient to change the code back to the old style to make this a single file fix rather than having to modify multiple files.
Is it possible to add weapons you can manuly spwan to this loot table? like SCAR_H_STD_EGLM_Spect?

And is there a reason why for example NV googles and G36 are commented out?

whats this? ["Body","object"],

and is it possible to change itemtypes? for example hospital to single items?
You can add objects as long as they are not banned or use RMOD to allow use of the banned items.

NVG's were removed from standard loot drops in military locations to make them more rare. They now only spawn on crash sites. The G36C Camo has not been added yet but was in the tables commented out. These tables are just copied directly from the config.cpp I left commented ones in to keep the files in order.

["Body","object"] has been in the loot tables long before I started doing script edits. I can only assume at one point the devs wanted to spawn corpses in buildings over loot, but have removed them due to more than likely causing problems of loot being picked up.
 
I have got this working on my server, but I want to edit the loot piles like trash, food, etc..
I've read every post in this thread with people asking about it, but I have found nothing really explaining how to do it. I've tried a few things out, but everything I've done seems to break loot spawns =p
Any help?

Other than that, works awesomely =D
 
@Seven,

I plan to add the extra buildings at some point. For Taviana.com, in the config.cpp, many of the buildings specific to Taviana have not been defined as well - I think there were two or three extra that are not found on Chernarus. However, for Taviana.eu, all of the extra Taviana specific buildings are defined, and I still plan to finish adapting your custom loot table for that version when I get the time. At the moment we are trying to get ready for Taviana 3.0 for when it arrives. Thanks again for your hard work on all of this.

Edit: I updated the custom loot table for Taviana to include two types of barracks which I had elided. I had noticed in game that these barracks buildings were spawning residential loot, when they should have been spawning military.
 
Back
Top