[Tutorial] Custom Loot Tables and Adjusting Spawn Rates

Looks like the server turns on now :D however no loot (I did the server.pbo edit) but no loot. Zombies spawn fine tho. Hmmm. Here are my PBO files in case you see something I don't.

http://www.quez.ca/dayz_1.chernarus.pbo
http://www.quez.ca/dayz_server.pbo

Thanks again man almost there :D i keep looking too


I would actually highly recommend against doing that server.pbo fix for now, since the coding in 1.8's server_cleanup.fsm is very different to the 1.7.7.1 file. Could cause more problems than it fixes. Personally I've never done the server side fix and everything works fine anyway.

In loot_init.sqf you missed to edits on lines 66 + 67.
 
I would actually highly recommend against doing that server.pbo fix for now, since the coding in 1.8's server_cleanup.fsm is very different to the 1.7.7.1 file. Could cause more problems than it fixes. Personally I've never done the server side fix and everything works fine anyway.

In loot_init.sqf you missed to edits on lines 66 + 67.

Ok, I put back my server.pbo (the one without server side fix), Then fixed the 2 lines that should read missionconfigFile, went over every other file to make sure, start server and still no loot, but have zombies. Man i'm sorry if I am annoying here hehe I really don't mean to. I'll keep checking :)

EDIT: I keep seeing errors like this
Code:
_item 
>
17:28:52  Error Undefined variable in expression: _item
17:28:52 File mpmissions\__cur_mp.chernarus\fixes\spawn_loot.sqf, line 94
17:28:52 Error in expression <lect 0,_iPos select 1,0]; };
 
 
 
switch (_iClass) do {
default {
 
_item = createV>
17:28:52  Error position: <_iClass) do {
default {
 
_item = createV>
17:28:52  Error Undefined variable in expression: _iclass
17:28:52 File mpmissions\__cur_mp.chernarus\fixes\spawn_loot.sqf, line 17
17:28:52 "Infected Camps: Loot spawn at 'Camp2_Small:[10547.2,10423.4,0]' with loot table ''"
17:28:52 Error in expression <it) < 10)} do {
 
Ok, I put back my server.pbo (the one without server side fix), Then fixed the 2 lines that should read missionconfigFile, went over every other file to make sure, start server and still no loot, but have zombies. Man i'm sorry if I am annoying here hehe I really don't mean to. I'll keep checking :)

EDIT: I keep seeing errors like this
Code:
_item
>
17:28:52  Error Undefined variable in expression: _item
17:28:52 File mpmissions\__cur_mp.chernarus\fixes\spawn_loot.sqf, line 94
17:28:52 Error in expression <lect 0,_iPos select 1,0]; };
 
 
 
switch (_iClass) do {
default {
 
_item = createV>
17:28:52  Error position: <_iClass) do {
default {
 
_item = createV>
17:28:52  Error Undefined variable in expression: _iclass
17:28:52 File mpmissions\__cur_mp.chernarus\fixes\spawn_loot.sqf, line 17
17:28:52 "Infected Camps: Loot spawn at 'Camp2_Small:[10547.2,10423.4,0]' with loot table ''"
17:28:52 Error in expression <it) < 10)} do {

It is frustrating, but not because of you man, just because it's always a pain when these things don't work even though the coding looks fine.
What I've done is completely rebuild the loot files, tested it and it's all working now. Though upon closer inspection I think your problem was CfgBuildingLoot.hpp! Looks like you've edited that and whatever program you used has broken it. When I opened it in notepad++ it was missing half of it's formatting. I'd say that's the most likely culprit for your problems.

Here's your working pbo.

What program did you use to edit it?
 
I've been lurking this thread for about a week, trying to fix all my errors but I can't hit the sweet spot. I host an Overwatch server on Dayz.St.

So far I can get zombies to spawn, but with no loot when killed. I can also get heli crashes to spawn but have no loot. I also can't get any loot to spawn at all, anywhere. I feel like I've messed up with calling the correct files. My mission.pbo is posted below, could anyone take a gander? I haven't added any scripts besides the ones added by the Overwatch crew themselves (self blood-bag, remove parts from vehicles). Thanks! I'll keep trying in the mean time.

http://www.mediafire.com/?1017jxamy1ccgev
 
I've been lurking this thread for about a week, trying to fix all my errors but I can't hit the sweet spot. I host an Overwatch server on Dayz.St.

So far I can get zombies to spawn, but with no loot when killed. I can also get heli crashes to spawn but have no loot. I also can't get any loot to spawn at all, anywhere. I feel like I've messed up with calling the correct files. My mission.pbo is posted below, could anyone take a gander? I haven't added any scripts besides the ones added by the Overwatch crew themselves (self blood-bag, remove parts from vehicles). Thanks! I'll keep trying in the mean time.

http://www.mediafire.com/?1017jxamy1ccgev

Hey, had a quick look and you've got a few problems.
First, you haven't put any of the changes into your compiles.sqf

Code:
Line 19: player_spawnCheck = compile preprocessFileLineNumbers "Fixes\player_spawnCheck.sqf";
Line 22: building_spawnLoot = compile preprocessFileLineNumbers "Fixes\building_spawnLoot.sqf";
Line 56: zombie_generate = compile preprocessFileLineNumbers "Fixes\zombie_generate.sqf";
Line 502: spawn_loot = compile preprocessFileLineNumbers "Fixes\spawn_loot.sqf";

(Line numbers may vary for compiles.sqf)

Then in variables.sqf you missed a configFile to missionconfigFile
Line 486

loot_init.sqf you have two with a double mission, so they read missionmissionconfigFile
Lines 5 + 37

:)
 
Hey, had a quick look and you've got a few problems.
First, you haven't put any of the changes into your compiles.sqf

Code:
Line 19: player_spawnCheck = compile preprocessFileLineNumbers "Fixes\player_spawnCheck.sqf";
Line 22: building_spawnLoot = compile preprocessFileLineNumbers "Fixes\building_spawnLoot.sqf";
Line 56: zombie_generate = compile preprocessFileLineNumbers "Fixes\zombie_generate.sqf";
Line 502: spawn_loot = compile preprocessFileLineNumbers "Fixes\spawn_loot.sqf";

(Line numbers may vary for compiles.sqf)

Then in variables.sqf you missed a configFile to missionconfigFile
Line 486

loot_init.sqf you have two with a double mission, so they read missionmissionconfigFile
Lines 5 + 37

:)


Oh wow >_<
Besides my errors I think I'll have to look into the overwatch calling lines more since this tutorial was designed for 1.8 DayZ. I tried it out and it worked perfectly until I changed something and then I got stuck on wait for host. I copied the BuildingLoot folder into the mission.pbo root and it worked until I started messing with things. I'll keep trying, but thanks! I'll be sure to check my call lines twice now lol/
 
Oh wow >_<
Besides my errors I think I'll have to look into the overwatch calling lines more since this tutorial was designed for 1.8 DayZ. I tried it out and it worked perfectly until I changed something and then I got stuck on wait for host. I copied the BuildingLoot folder into the mission.pbo root and it worked until I started messing with things. I'll keep trying, but thanks! I'll be sure to check my call lines twice now lol/

This tutorial was made quite a while before 1.8.
If you're running overwatch, remember to take the files from the @DayzOverwatch folder and not the @DayZ folder.
 
================== INSTALLING CUSTOM LOOT TABLES =====================

Ok now that we have everything unpacked lets move to the next step

Open up your mission folder and create a folder named Fixes. (This is where we will be putting most of our edits.)

Now let's open our dayz_code folder this is the list of files that you will need to copy and paste into your Fixes folder:
  • dayz_code\init\compiles.sqf
  • dayz_code\init\loot_init.sqf
  • dayz_code\init\variables.sqf
  • dayz_code\compile\building_spawnLoot.sqf
  • dayz_code\compile\building_spawnZombies.sqf
  • dayz_code\compile\player_spawnCheck.sqf
  • dayz_code\compile\spawn_loot.sqf
  • dayz_code\compile\zombie_generate.sqf
Once you have copied each of those into your Fixes folder move to the next part.
In the main directory of you mission.pbo folder you will need to copy and paste these three files:
  • dayz_code\Configs\CfgLoot\CfgBuildingLoot.hpp
  • dayz_code\Configs\CfgLoot\CfgBuildingPos.hpp
  • dayz_code\Configs\CfgLoot\CfgLoot.hpp
Once you have done that move to the next part.
After all this has been done open up description.ext in the root of your mission.pbo and place this line at the very top:
Code:
#include "cfgBuildingLoot.hpp"
Save your changes.
Open up init.sqf and edit these lines:
Variables
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
to
Code:
call compile preprocessFileLineNumbers "Fixes\variables.sqf";//Initilize the Variables (IMPORTANT: Must happen very early)
Compiles
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";//Compile regular functions
to
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";//Compile regular functions

Save your changes and we can move to the next part.
After you have done this move to the compiles.sqf in your fixes folder and edit the folder call on each of these lines to correspond to the Fixes folder:
  1. ================== INSTALLING CUSTOM LOOT TABLES =====================

    Ok now that we have everything unpacked lets move to the next step

    Open up your mission folder and create a folder named Fixes. (This is where we will be putting most of our edits.)

    Now let's open our dayz_code folder this is the list of files that you will need to copy and paste into your Fixes folder:
    [*]dayz_code\init\compiles.sqf
    [*]dayz_code\init\loot_init.sqf
    [*]dayz_code\init\variables.sqf
    [*]dayz_code\compile\building_spawnLoot.sqf
    [*]dayz_code\compile\building_spawnZombies.sqf
    [*]dayz_code\compile\player_spawnCheck.sqf
    [*]dayz_code\compile\spawn_loot.sqf
    [*]dayz_code\compile\zombie_generate.sqf
Once you have copied each of those into your Fixes folder move to the next part.
In the main directory of you mission.pbo folder you will need to copy and paste these three files:
  • dayz_code\Configs\CfgLoot\CfgBuildingLoot.hpp
  • dayz_code\Configs\CfgLoot\CfgBuildingPos.hpp
  • dayz_code\Configs\CfgLoot\CfgLoot.hpp
Once you have done that move to the next part.
After all this has been done open up description.ext in the root of your mission.pbo and place this line at the very top:
Code:
#include "cfgBuildingLoot.hpp"
Save your changes.
Open up init.sqf and edit these lines:
Variables
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf"; //Initilize the Variables (IMPORTANT: Must happen very early)
to
Code:
call compile preprocessFileLineNumbers "Fixes\variables.sqf";//Initilize the Variables (IMPORTANT: Must happen very early)
Compiles
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";//Compile regular functions
to
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";//Compile regular functions

Save your changes and we can move to the next part.
After you have done this move to the compiles.sqf in your fixes folder and edit the folder call on each of these lines to correspond to the Fixes folder:
  1. Line 19: player_spawnCheck = compile preprocessFileLineNumbers "Fixes\player_spawnCheck.sqf";
  2. Line 22: building_spawnLoot = compile preprocessFileLineNumbers "Fixes\building_spawnLoot.sqf";
  3. Line 56: zombie_generate = compile preprocessFileLineNumbers "Fixes\zombie_generate.sqf";
  4. Line 502: spawn_loot = compile preprocessFileLineNumbers "Fixes\spawn_loot.sqf";
Now you will need to open each of the files that you placed and look for
Code:
_config = configfile >> "CfgBuildingLoot" >> _type;
anything that has to do with cfgbuildingloot and cfgloot will need to read as:
Code:
_config = missionConfigfile >> "CfgBuildingLoot"

Save your edits then move to variables.sqf and edit this line to correspond to call out of the fixes folder.

  1. Line 420: call compile preprocessFileLineNumbers "Fixes\loot_init.sqf";
Save your changes and continue.

Congratulations you have installed the necessary files and can now customize your loot tables!

  1. Line 19: player_spawnCheck = compile preprocessFileLineNumbers "Fixes\player_spawnCheck.sqf";
  2. Line 22: building_spawnLoot = compile preprocessFileLineNumbers "Fixes\building_spawnLoot.sqf";
  3. Line 56: zombie_generate = compile preprocessFileLineNumbers "Fixes\zombie_generate.sqf";
  4. Line 502: spawn_loot = compile preprocessFileLineNumbers "Fixes\spawn_loot.sqf";
Now you will need to open each of the files that you placed and look for
Code:
_config = configfile >> "CfgBuildingLoot" >> _type;
anything that has to do with cfgbuildingloot and cfgloot will need to read as:
Code:
_config = missionConfigfile >> "CfgBuildingLoot"

Save your edits then move to variables.sqf and edit this line to correspond to call out of the fixes folder.

  1. Line 420: call compile preprocessFileLineNumbers "Fixes\loot_init.sqf";
Save your changes and continue.

Congratulations you have installed the necessary files and can now customize your loot tables!

Hi,

Nice stuff except when you got to this line:
anything that has to do with cfgbuildingloot and cfgloot will need to read as:

this shortcut does not explain what you put on each of those lines as they have different instructions

so its not exactly clear as to what to look for and replace on those lines.

Could you clarify atleast on cfgloot line and the replacement example? Thanks for your tutorial

Gramps
 
Hi,

Nice stuff except when you got to this line:
anything that has to do with cfgbuildingloot and cfgloot will need to read as:

this shortcut does not explain what you put on each of those lines as they have different instructions

so its not exactly clear as to what to look for and replace on those lines.

Could you clarify atleast on cfgloot line and the replacement example? Thanks for your tutorial

Gramps


All of the calls are slightly different, so it's easiest to search for
Code:
configFile
and replace any instance where it points to cfgBuildingLoot or CfgLoot with
Code:
missionconfigFile
 
Was just helping somebody with an unrelated problem when I stumbled upon an issue with custom loot tables.
Turns out there are three files in dayz_server which also need edited. They don't cause a problem unless you edit the heli crash loot table or castle loot table which is probably why most people haven't noticed or haven't cared about the errors spamming their RPT.

The files you need to edit are
dayz_server\compile\fa_hiveMaintenance.sqf on line 76
Code:
    _config = configFile >> "CfgBuildingLoot" >> "HeliCrash";
dayz_server\compile\fn_bases.sqf on line 25
Code:
    _itemTypes =    [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
dayz_server\compile\server_spawnCrashSite.sqf on line 84
Code:
            _itemTypes = [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
 
I followed this guide 5 times 100%, my report shows no errors but I have no zeds and no loot. If I put the files back to the PBO locations everything works fine. Is there a common no zed and no loot fix that I have missed? I have read and tried every fix in this thread, nothing doing it for me.

EDIT: Started from scratch and then used this link https://github.com/AVendettaForYou/DayZ_1.8_Custom_Loot_Tables - it is all working now. Cheers Vendetta
 
I followed this guide 5 times 100%, my report shows no errors but I have no zeds and no loot. If I put the files back to the PBO locations everything works fine. Is there a common no zed and no loot fix that I have missed? I have read and tried every fix in this thread, nothing doing it for me.

EDIT: Started from scratch and then used this link https://github.com/AVendettaForYou/DayZ_1.8_Custom_Loot_Tables - it is all working now. Cheers Vendetta

That's strange. When I looked through your files for base building the other day I thought I fixed the issue for custom loot at the same time. Glad you got it going now anyway.
 
That's strange. When I looked through your files for base building the other day I thought I fixed the issue for custom loot at the same time. Glad you got it going now anyway.

Even though I always think I have done it right there is always something missing or wrong, so tiny that it can be missed. The other day I was missing 1 apostrophe and the whole server wouldn't load. But I guess when you look and look at something you get blinded by the text. Can't see the forest for all the trees! It's great there is a community like this for us to bounce off of each other
 
Back
Top