[Tutorial] Custom Loot Tables and Adjusting Spawn Rates

Forgot to mention(sorry for double post)
This seems to work, although if i change the cfgloot.hpp or cfgbuildingloot.hpp the server will not allow clients to connect. It hangs at Waiting for server to start authentication. How am suppose to know if its working if i cannot edit the loot table? What good does a custom loot table do if i cannot customize it?
 
Your link for the server file is the same as the link for the mission file.

The fact you can't customise it means something is wrong, the whole point in this is to allow customisation.
 
For simple debug purposes i changed CfgLoot.hpp so it looked like this:

Code:
class CfgLoot {
 
    #include "BuildingLoot\Supermarket.hpp"
    #include "BuildingLoot\Farm.hpp"
    #include "BuildingLoot\Industrial.hpp"
    #include "BuildingLoot\Residential.hpp"
    #include "BuildingLoot\Church.hpp"
    #include "BuildingLoot\militaryEAST.hpp"
    #include "BuildingLoot\militaryWEST.hpp"
    #include "BuildingLoot\Hospital.hpp"
    //#include "BuildingLoot\Military.hpp"
    #include "BuildingLoot\Hunter.hpp"
   
    //Zed Loot
    policeman[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
    civilian[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
    viralloot[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
    food[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
    generic[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
    military[] = {
        {"FoodCakeCremeCakeClean",0.01},
        {"ItemSodaMtngreen",0.01}
    };
};

Ran around, killed zombies, they were dropping pasta and bandages....
 
You're missing the medical class from that list. Also, so you know, it's only the top three that are zombie classes, the rest are used in combination with cfgbuildingloot as each building will have unique items plus a combination of calls to the classes in cfgloot.

For instance a supermarket has 'generic' loot included, hospitals would have 'medical' loot included etc.
 
Yea, i am aware of that :) But if medical is missing than medical is missing from dayz_code, as i changed nothing other than pasting the cremecake and soda in there. So in your opinion should the snack/soda be the only thing dropping from zombies ?
 
Yea, i am aware of that :) But if medical is missing than medical is missing from dayz_code, as i changed nothing other than pasting the cremecake and soda in there. So in your opinion should the snack/soda be the only thing dropping from zombies ?

Medical isn't missing in the files you uploaded, so it's missing since your newer edits.

In theory they should yes, but I'm not 100% sure that all zombie loot is contained in those tables, also one error in a file can cause unpredicted results so perhaps you should fix the file and then see if it works.
 
Ahh, i made the same edits like 5-6 times, been banging my head against the wall, thanks for pointing that out. Have skype? teamspeak? If you wouldn't mind a chat, we might be able to get to the bottom of this.
 
Ahh, i made the same edits like 5-6 times, been banging my head against the wall, thanks for pointing that out. Have skype? teamspeak? If you wouldn't mind a chat, we might be able to get to the bottom of this.

I'm afraid I really don't have time for Skype or that just now, I'm pretty busy. Though the problem is fixed really. I tested your file with the medical class added where it should be and it seemed to work fine. Didn't get any errors in the RPT and out of twenty zombies I killed, all I found was one empty tin can (trash loot always has a chance of spawning unless it's disabled), which would be about right considering they only have two items and each of them only have a 0.01 chance of spawning on them.
 
I added the medical back, and now once again, stuck at Waiting for server to start authentication......

Hmmm, strange, I can't get back on my own test server with your file in now either. Yet I was on when I tested it.
Replaced your file with my own and it works again. I'm starting to think it may be the sheer lack of items in your list. I'm not 100% on the loot logic, perhaps AVendettaForYou will have more information.
For now, I'd recommend not cutting the file down nearly so much. Try adding things instead of removing everything, or adjusting the spawn rates for existing items etc.
 
Yea, it seems to work but is really wierd, i was mainly wiping the loot tables and doing it this way for an easier test. Considering i am the only tester online at the moment, didn't want to spend long time watching loot rates. The tutorial works though! Thanks for the extra help!
 
Yea, it seems to work but is really wierd, i was mainly wiping the loot tables and doing it this way for an easier test. Considering i am the only tester online at the moment, didn't want to spend long time watching loot rates. The tutorial works though! Thanks for the extra help!

No worries man. :)
Whenever I install the custom loot, to make sure it's working I add tents to all cfgbuildingloot classes and give them a spawn chance of 1.00, means I can tell it's working pretty much straight away because there are tents everywhere. :)
 
Oh man, I'm sorry I know straight away what the problem is haha. I've only set them up once on 1.8 so far so totally forgot about the new folder you need.
In dayz_code\configs\cfgloot\
You want to copy the "BuildingLoot" folder to the root of your mission file.

Oh so simply drop the BuildingLoot folder in root and it will work? (or should)
 
Aren't you running 1.8?
If so, then I think you've taken the wrong files. cfgloot.hpp for instance is not the 1.8 version, it's missing sections for 1.8 loot and it's missing all the calls at the top which should look like this
Code:
class CfgLoot {
 
    #include "BuildingLoot\Supermarket.hpp"
    #include "BuildingLoot\Farm.hpp"
    #include "BuildingLoot\Industrial.hpp"
    #include "BuildingLoot\Residential.hpp"
    #include "BuildingLoot\Church.hpp"
    #include "BuildingLoot\militaryEAST.hpp"
    #include "BuildingLoot\militaryWEST.hpp"
    #include "BuildingLoot\Hospital.hpp"
    //#include "BuildingLoot\Military.hpp"
    #include "BuildingLoot\Hunter.hpp"

Make sure you've updated your local install of DayZ to 1.8 and try copying the files over again, including the buildingloot folder which needs to be in the root of your mission file. If you place the buildingloot folder in the fixes folder, be sure to edit those lines in cfgloot.hpp.


No idea how I crossed files but it's sorted as of now. Thanks!
Just to make sure I have everything sorted in the mission.pbo I will upload it again. Everything seems to be working... Well loot and zeds are spawning but it doesn't seem like the lootspawnbias is working and I haven't messed with the loot tables as of yet. I obviously will have to test further and make some changes.
I think the only thing I'm concerned about is that I have missionConfigFile replacing everything I need it to. Thanks in advance!

http://www.filedropper.com/dayz1chernarus_1
 
No idea how I crossed files but it's sorted as of now. Thanks!
Just to make sure I have everything sorted in the mission.pbo I will upload it again. Everything seems to be working... Well loot and zeds are spawning but it doesn't seem like the lootspawnbias is working and I haven't messed with the loot tables as of yet. I obviously will have to test further and make some changes.
I think the only thing I'm concerned about is that I have missionConfigFile replacing everything I need it to. Thanks in advance!

http://www.filedropper.com/dayz1chernarus_1

Haha, these things happen eh. :)
Ok, for this load I just did a quick check and you've missed a couple of the missionconfigFile changes.
Variables.sqf line 456
spawn_loot.sqf line 25
loot_init.sqf lines 66 +67

Also zombie_generate.sqf
Lines 59, 90 + 97
Though the last file isn't really as important as I'm pretty sure it isn't needed for the custom loot since we don't actually change the path to it from compiles.sqf

I noticed that the loot spawn bias variable isn't even listed by default any more in the 1.8 code, not sure if it can be added back in or if it's been removed and thus adding it will do nothing. Haven't really had a play with it yet.
 
Back
Top