[Tutorial] Custom Loot Tables and Adjusting Spawn Rates

From the instructions in the OP, follow them to get a copy of 'player_spawnCheck.sqf' into your mission file. Then you want to find the section near the bottom that looks something like this.
Code:
        if (_currentWeaponHolders < _maxWeaponHolders) then {
            //Baisc loot checks
            if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then {
 
                _looted = (_x getVariable ["looted",(diag_tickTime + dayz_tickTimeOffset)]);     
                _age = ((diag_tickTime + dayz_tickTimeOffset) - _looted);
                //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
 
                if ((_age < 0) or (_age == 0) or (_age > 900)) then {
                    _x setVariable ["looted",diag_tickTime,!_islocal];                   
                    _x call building_spawnLoot;
                    if (!(_x in dayz_buildingBubbleMonitor)) then {
                        //add active Building to var
                        dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x];
                    };
                };
            };
        };

If you comment out that section with /* at the start and */ at the end, it should effectively stop loot spawning.
 
From the instructions in the OP, follow them to get a copy of 'player_spawnCheck.sqf' into your mission file. Then you want to find the section near the bottom that looks something like this.
Code:
        if (_currentWeaponHolders < _maxWeaponHolders) then {
            //Baisc loot checks
            if ((_dis < 125) and (_dis > 30) and !_inVehicle and _checkLoot) then {
 
                _looted = (_x getVariable ["looted",(diag_tickTime + dayz_tickTimeOffset)]);
                _age = ((diag_tickTime + dayz_tickTimeOffset) - _looted);
                //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
 
                if ((_age < 0) or (_age == 0) or (_age > 900)) then {
                    _x setVariable ["looted",diag_tickTime,!_islocal];         
                    _x call building_spawnLoot;
                    if (!(_x in dayz_buildingBubbleMonitor)) then {
                        //add active Building to var
                        dayz_buildingBubbleMonitor set [count dayz_buildingBubbleMonitor, _x];
                    };
                };
            };
        };

If you comment out that section with /* at the start and */ at the end, it should effectively stop loot spawning.
so I have the player_spawnCheck.sq and placed it in the fixes folder, and cancelled it out... so I just add

[] execVM "fixes\effects.sqf";

to the bottom of the inti. sqf?
 
Not sure where you got effects.sqf, but no. You need to have a custom compiles (you may already have one in your mission file). Either the full compiles, in which case find the line for player_spawnCheck.sqf and edit the path. Or if you have a compiles.sqf that you just add the required lines to then you'd want this line (edited for the correct path obviously).
Code:
player_spawnCheck =        compile preprocessFileLineNumbers "customloot\player_spawnCheck.sqf";
 
Not sure where you got effects.sqf, but no. You need to have a custom compiles (you may already have one in your mission file). Either the full compiles, in which case find the line for player_spawnCheck.sqf and edit the path. Or if you have a compiles.sqf that you just add the required lines to then you'd want this line (edited for the correct path obviously).
Code:
player_spawnCheck =        compile preprocessFileLineNumbers "customloot\player_spawnCheck.sqf";
cool i got it! thanks

is there some thing I can do to remove the dead bodies after 15 minutes?

I hear this causes lag to. As of now they forever stay on the ground
 
cool i got it! thanks

is there some thing I can do to remove the dead bodies after 15 minutes?

I hear this causes lag to. As of now they forever stay on the ground

No worries man. :)

I believe dead bodies are removed after 20 minutes (that may vary depending on map and version). If you look in server_cleanup.fsm, there should be something which may look like this
Code:
if (diag_tickTime - _deathTime > 1200) then {
You should just be able to adjust that 1200 (which is 20 minutes) to something lower so it will clear bodies sooner after death.
 
What map and mod are you using ?

Initial suggestions are:

Make sure you have the correct dayz_code and mission pbos and the correct CfgBuildingLoot.hpp and other hpp's.

1) Be sure you followed the instructions to the letter;
2) Verify that the zombies and loot are spawning if you use the default configuration but with files modified as instructed;
3) Carefully change the loot chance in CfgBuildingLoot.hpp;
 
Hey guys,

I am very new at this server editing stuff, but i have been trying for 3 days to install custom loot on my epoch server.

I am aware that epoch ( for some reason) is different then the OPs DAYz instructions.

I've read through all the posts and found some posts regarding the differences, but i'm still in the dark on how to actually make it work.

The .hpp files are now all in one .bin file for the new epoch, and i used unrap to pull them out, but when i follow the instructions after that i still get stuck on waiting for host.

I just got done restoring the code on the server so i could give it a new whirl, but i would really like some help from someone who understands this stuff and can explain it from an epoch server perspective.

Thank you in advance for any help that can be rendered.
 
You can get the hop/cpp files at:
https://github.com/vbawol/DayZ-Epoch/tree/master/SQF/dayz_code/Configs/CfgBuildingLoot

Have you looked at your .rpt file ? It usually tells you the error that caused the server to hang.

I would go back to a default misson.pbo and start over, perhaps testing after each step of the modification procedure to be sure it is working, e.g., after you switch to a custom compile, after you add in custom variables, and after you redirect your compiles to the custom files you have copied such as loot_init.sqf.
Once you have it all assembled with default CfgBuildingLoog files you are ready to start changing things.
 
At first glance this seemed to work just fine, at closer inspection i found at that there spawns lootpiles wherever possible in every building. I can't find anything in CfgBuildingLoot.hpp, CfgBuildingPos.hpp, variables.sqf or building_spawnLoot.sqf that would give lootpiles a 100% chance. This happens in every sort of building (industrial, residential,...) without exception. Im using DayZ Chernarus 1.8.0.3. Can someone help with this issue? Thx in advance
 
I don't see anything in the 1.8 variables.swg that says dayz_tagDelayWeaponHolders, so how do we adjust the adjust the delay? Or loot spawn bias, so how do we adjust the chance for loot pile to spawn?
 
Hey guys, i found a guide for epoch but it is confusing me pretty well.

http://epochmod.com/forum/index.php?/topic/1848-custom-loot-tables-via-missionconfigfile/

I took a look at the read me, and im confused which files i would change config to Missionconfig.

also, it says to Mission fix the following files in your compiles.sqf........

which compiles.sqf would he be referring to? he didn't have one in the mission folder like the OP does here, does he mean in the server_pbo area? if so how does it know the file path to the files in the mission.pbo?

just /custom/blahblah means it is in the root of the server.pbo right? but i didn't put any files there.
 
Kildar,

There is a very nice package from Tornedco available at the link below. All of the files you need to change are included with the corrections needed for custom loot spawns. The only thing you need to do is follow the brief directions or, if you already have customized compiles and/or variables files, merge the changes in the files Tornedco provides with yours. His version solves the problems we had with zombies spawning without loot, which occured when we ran modified loot tables using the procedures for straight DayZ 1.7.7 described in the tutorial here. Thse issues were due to our not realizing that zombie loot spawning calls additional code that we had not included in our original build. I hope this helps. The link is:

https://github.com/Torndeco/Epoch-Custom-Loot
 
Hey guys,

Can anyone help me with the loot spawn configuring, I got the loot spawns working and it seems to be in there correctly.
I tried it out by trying to give the desert eagle a high spawn in the barraks but it doesn't spawn with a 0.9 spawn chance.
If anyone could give me a hand it would be very much appreciated?!

P.S. If I'm in the wrong section I'm sorry..
 
Back
Top