100% Custom Loot tables - TUTORIAL

So..
I deleted the Junk but.. The loot dont spawn ..
Or to say it better .. No loot spawn nothing
Make sure you have all your comma's (,) after your lines! i had the same problem and i was only forgetting one comma and it did the same thing to me
 
Remember to always check your client log
Code:
%appdata%\..\local\ArmA 2 OA\
Put this in your explorer bar and it will bring you to where your log file is stored. It will hold any script errors and will guide you to where you have went wrong.
 
Hello Seven,

First of all, thanks a ton!

Just a quick question that I didn't see answered (if it was, apologies, I'm old!)

Can I change the _LootClass of a particular building?

I'm considering changing the tents in Cherno to Military or MilitarySpecail (and by extension, maybe the tents in Berezino, too).

So...
case "MASH": { _LootClass = "Hospital"; };
case "MASH_EP1": { _LootClass = "Hospital"; };
case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };

Just changing Hospital to the appropriate Military or MilitarySpecial would be all I have to do?

Thanks!
Cur
 
changing these to military will make all tents with those class names military. Not specific ones in towns. You cannot use this code to edit a single building it will change all of the same type.
 
changing these to military will make all tents with those class names military. Not specific ones in towns. You cannot use this code to edit a single building it will change all of the same type.

Ok, so it would also change Berezino, and Stary Sobor, too.

I'll keep that in mind. Thanks for the fast reply and great work helping the community Seven. You're a peach!
 
changing these to military will make all tents with those class names military. Not specific ones in towns. You cannot use this code to edit a single building it will change all of the same type.
Hey Seven i took out the m107's and as50's but ammo is still spawning? Also in the fire houses ammo don't spawn with the guns? And in residential houses military ammo is spawning. (i found m107, ak, and DMR mags in residential) Do you know why its doing this and how to fix it?
 
I have had this working for weeks the way I want it to on Taviana. I also took out the two .50 rifles and I think that ammo for them still spawns because it is a part of the ["","military"], loot item. As for the mil ammo spawning in residential, I don't have that and I have replaced just about every normally spawning weapon with something else. Did you change those residential buildings to the military loot class? If not I wonder if it could be that the balance of your whole loot spawning table is unbalanced due to changes you've made?
 
I have had this working for weeks the way I want it to on Taviana. I also took out the two .50 rifles and I think that ammo for them still spawns because it is a part of the ["","military"], loot item. As for the mil ammo spawning in residential, I don't have that and I have replaced just about every normally spawning weapon with something else. Did you change those residential buildings to the military loot class? If not I wonder if it could be that the balance of your whole loot spawning table is unbalanced due to changes you've made?
In residence i have ["","military"] and its value is at 2.50. Haha that's probably whats wrong, correct? Should i change it to 0.00 or remove it completely.
 
In residence i have ["","military"] and its value is at 2.50. Haha that's probably whats wrong, correct? Should i change it to 0.00 or remove it completely.

mine (["","military"],) in Residetial, is a o.03. It seems to be there by default, so I wouldn't remove it.
 
My question is, do all the number have to add up to something per building?

I tried increasing a few weapons spawn chance in MilitarySpecial, which made no loot spawn anywhere! I reversed the changes and it went back to normal.
 
This may sound stupid.....but why is the camping tent not in the tables?

EDIT : Completely ignore me, i'm stupid.
 
Yes I will be releasing a new version once I get confirmation that the tables are final.
 
So, I am no stranger to adding scripts to DayZ. I've got a bunch of them on my server, but this one isn't working for me.

I added this to my init.sqf file:

building_spawnLoot = compile preprocessFileLineNumbers "custom\building_spawnLoot.sqf";

I have all my scripts in the "custom" folder instead of "fixes". I copied and pasted the building_spawnLoot.sqf from the pastebin link in the first post and uploaded everything to my server's "custom" folder. I started the server, went to the nearest building with items that spawn just to be sure something would spawn while I was on the server and there's no mention in my client side RPT of "SPAWNING WITH CUSTOM LOOT". Just for testing purpose, I made a 100% chance of a an AS50 spawning in industrial buildings and I entered a gas station and there was no AS50, only the standard gas station loot.

My init.sqf:

Code:
startLoadingScreen ["", "DayZ_loadingScreen"];
enableSaving [false, false];
 
dayZ_instance = 1;
hiveInUse = true;
initialized = false;
dayz_previousID = 0;
 
// Settings
player setVariable ["BIS_noCoreConversations", true];// Disable greeting menu
enableRadio false;// Disable global chat radio messages
 
fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Self Bloodbag
 
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";// Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";// Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";// Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";// Compile regular functions
progressLoadingScreen 1.0;
stream_locationCheck = {}; //Remove all junk and bases added by Rocket
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
 
player setVariable ["BIS_noCoreConversations", true];
//enableRadio false; // Disable global chat radio messages
 
if (isServer) then {// If mission is loaded by server execute the server monitor
hiveInUse = true;
_serverMonitor = [] execVM "\z\addons\dayz_server\system\server_monitor.sqf";
};
 
if (!isDedicated) then {  // If mission is loaded by a player execute the player monitor
0 fadeSound 0;
0 cutText [(localize "STR_AUTHENTICATING"), "BLACK FADED", 60];
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
   "heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
 
#include "gcam\gcam_config.hpp"
#include "gcam\gcam_functions.sqf"
 
#ifdef GCAM
waitUntil { alive Player };
waituntil { !(IsNull (findDisplay 46)) };
 
if (serverCommandAvailable "#kick") then { (findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_keyDown"]; };
#endif
};
 
call compile preprocessFileLineNumbers "addons\UPSMON\scripts\Init_UPSMON.sqf";
 
call compile preprocessFileLineNumbers "addons\SHK_pos\shk_pos_init.sqf";
 
[] execVM "addons\SARGE\SAR_AI_init.sqf"; // Sarge's AI
 
call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile custom compiles
building_spawnLoot = compile preprocessFileLineNumbers "custom\building_spawnLoot.sqf"; //Custom loot tables
 
[] execVM "scripts\kh_actions.sqf"; //Autorefuel

My client report file: http://pastebin.com/ghFtZHTT
 
You are running a custom compiles.sqf. This can override this fix, move the building_spawnLoot = compile preprocessFileLineNumbers "custom\building_spawnLoot.sqf"; line into the compiles and override the original one in there
 
It a weighted percentage. Take the three examples. Say every 0.01 = 1 so 0 to 9 is medical 10 to 109 is generic and 110 to 359 is military
You would then run a random int from 0 to the max total items (359). If it lands in any of these ranges it will decide on what item is spawning. The more of the same item is going to give it a higher chance of spawning.

There are many ways of handling this. But this is the simplest way to explain what is going on.

I'm sorry, but that makes NO sense to me. I've never been very good with math. Any easier way to explain it?
 
You are running a custom compiles.sqf. This can override this fix, move the building_spawnLoot = compile preprocessFileLineNumbers "custom\building_spawnLoot.sqf"; line into the compiles and override the original one in there

Yeah, did that while waiting for a reply (thanks for the fast reply BTW), and got it working. :)
 
I'm sorry, but that makes NO sense to me. I've never been very good with math. Any easier way to explain it?
ok you have 3 Items bandage, flare, painkillers. each one with a certain drop chance 0.2, 0.5, 0.9 we then take every 0.1 as 1 chance. So we build a list.

[1,1,2,2,2,2,2,3,3,3,3,3,3,3,3,3]

So bandage is in twice, flare in 5 times, and painkillers in 9 times.

We then do a randomInt(16) command, (16 being the total size of our list) which picks a random item from the list, because there are 9 painkillers over the two bandages. It has a higher chance of being picked.
 
ok you have 3 Items bandage, flare, painkillers. each one with a certain drop chance 0.2, 0.5, 0.9 we then take every 0.1 as 1 chance. So we build a list.

[1,1,2,2,2,2,2,3,3,3,3,3,3,3,3,3]

So bandage is in twice, flare in 5 times, and painkillers in 9 times.

We then do a randomInt(16) command, (16 being the total size of our list) which picks a random item from the list, because there are 9 painkillers over the two bandages. It has a higher chance of being picked.

Ok, that makes a bit more sense to my mathematically challenged mind. :)
 
Back
Top