[Tutorial] Custom Loot Tables and Adjusting Spawn Rates

Here is my mission file. As it sits now, the game loads, I can get into the map fine. But I get no zombies and no loot. Also, there are no errors in the RPT. Can someone tear into this and see what I'm missing? Thanks in advance for the help!

Trinity Mission File PBO
Well the loot problem is because you forgot to tell it to include the cfgLoot.hpp.

Open up your cfgBuildingLoot.hpp and add this to the top of it,
Code:
#include "cfgLoot.hpp"

As for the zombies, I think the tutorial has a slight error in it, either that or I got lucky.
Even though it tells you to copy over 'building_spawnZombies.sqf' it doesn't actually mention editing the path to it in compiles.sqf, so I left mine pointing at the original file and have no problems with that. Try reverting that line to this and see how you get on.
Code:
    building_spawnZombies =        compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
 
The method as listed in the instructions works fine on Overwatch, but not on Trinity. Weird....

The file structure for Overwatch is the same as it is for Chernarus. Trinity uses a slightly different file structure so you need to modify things differently.
 
AM I CHANING ALL THE configFiles to missionConfigFile such as ....................?

Code:
agent = objNull;
if (count _unitTypes == 0) then {
    _unitTypes = []+ getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
};

or just the lines that are


Code:
_config = configFile >> "CfgBuildingLoot" >> _type;
Can anyone really explain this in detail?
Does all files that was extracted from dayz_code have to be changed? And does CfgLoot got to be change from CfgLoot to CfgBuildingLoot too?
 
Can anyone really explain this in detail?
Does all files that was extracted from dayz_code have to be changed? And does CfgLoot got to be change from CfgLoot to CfgBuildingLoot too?

In EVERY file that you copied over, check for all references to the following,
Code:
configfile >> "cfgLoot"
and
Code:
configfile >> "CfgBuildingLoot"

Then change them all to,
Code:
missionconfigfile >> "cfgLoot"
and
Code:
missionconfigfile >> "CfgBuildingLoot"
respectively.
 
In EVERY file that you copied over, check for all references to the following,
Code:
configfile >> "cfgLoot"
and
Code:
configfile >> "CfgBuildingLoot"

Then change them all to,
Code:
missionconfigfile >> "cfgLoot"
and
Code:
missionconfigfile >> "CfgBuildingLoot"
respectively.

I had this fixed and working.
but basically, like what you said, just add the word "mission" before "configfile"

thanks anyways ;) good job on this post.
 
Ok, everything in there looks all right except there is one error in spawn_loot.sqf
On line 51 you've changed cfgWeapons to point to your mission file. It should be like this still
Code:
        _mags = [] + getArray (ConfigFile >> "cfgWeapons" >> _iItem >> "magazines");

Try that and see how you get on. :)

:/ nope, still not work
but funny is, that the loot in zombies is spawning!!? :D
 
================== 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!

Fantastic tutorial. This is now working for me, thank you.
 
:/ nope, still not work
but funny is, that the loot in zombies is spawning!!? :D

Hmm, strange. Ok can you send me your mission file and your server.pbo so I can test it locally and see if I can get it working for you? I couldn't run it yesterday as your mission file isn't compatible with my server.pbo haha.
 
Hmm, strange. Ok can you send me your mission file and your server.pbo so I can test it locally and see if I can get it working for you? I couldn't run it yesterday as your mission file isn't compatible with my server.pbo haha.

hey sir! :) sounds nice, the mod is overwatch (0.2.4)
mission pbo: http://www.file-upload.net/download-8083019/dayz_1.chernarus.pbo.html
server pbo: http://www.file-upload.net/download-8086345/dayz_server.pbo.html

if there is a way to add it via server.pbo, i will try it again... thanks for you help
 
hey sir! :) sounds nice, the mod is overwatch (0.2.4)
mission pbo: http://www.file-upload.net/download-8083019/dayz_1.chernarus.pbo.html
server pbo: http://www.file-upload.net/download-8086345/dayz_server.pbo.html

if there is a way to add it via server.pbo, i will try it again... thanks for you help

Ah ok, that explains it haha I was trying to run it using the standard Chernarus server.pbo! Sadly you need to make these changes in the mission file so the connecting clients download them. I'll take a look and see if I can get it working though.
 
hey sir! :) sounds nice, the mod is overwatch (0.2.4)
mission pbo: http://www.file-upload.net/download-8083019/dayz_1.chernarus.pbo.html
server pbo: http://www.file-upload.net/download-8086345/dayz_server.pbo.html

if there is a way to add it via server.pbo, i will try it again... thanks for you help
Ok man, there were a few problems with it that I didn't notice last night.
Most, if not all, of the edited lines were missing the _type; from the end of them, you had them like this
Code:
missionConfigFile >> "CfgBuildingLoot" >>
Instead of like this
Code:
missionConfigFile >> "CfgBuildingLoot" >> _type;
This is why no loot was spawning.

Also you'd taken the Chernarus loot files, but since you use Overwatch you should have taken the files from
@DayZOverwatch\addons\dayz_code.pbo
That's not why it didn't work, but it would mean you wouldn't get any of the Overwatch specific loot.

I've replaced the files with the Overwatch files and edited them all to point to the right places. Ran a quick test and saw quite a bit of loot spawned in town so it's all good to go, now you'll just need to customise it how you want. :)

Download Link
 
how does one do this for namalsk?

it uses:

dayzNam_buildingLoot = "CfgBuildingLootNamalsk";

but I can't find it anywhere in the pbo's
 
how does one do this for namalsk?

it uses:

dayzNam_buildingLoot = "CfgBuildingLootNamalsk";

but I can't find it anywhere in the pbo's

Never used Namalsk myself so I don't have the server files to check but you could try looking in your server.pbo.
If they aren't there then it's possible it's a variable and not a file, in which case you can just take the files from the config\CfgLoot\ folder within Namalsk's dayz_code.pbo like all the other maps. You may have to comment out or remove the call to that in your init.sqf too.
 
Back
Top