Jump to content
  • 0

Howto setup Custom Loot with DZE_MissionLootTable


Revoplay

Question

Any Hints or something?

 

I found this in dayz_code

if (DZE_MissionLootTable) then {
	_config = missionConfigFile >> "CfgBuildingLoot";
} else {
	_config = configFile >> "CfgBuildingLoot";
};

But how?

 

I think missionConfigFile will be init.sqf, but then? And with files do i need?

Link to comment
Share on other sites

Recommended Posts

  • 0

I'm currently finding this to be quite a difficult task to complete...I've added the line into description.ext, as well as the call in the init.sqf. I've then copied over the 4 files into the loottables folder and added the line at the bottom of cfgbuildingloot.hpp for cfgloot.hpp, yet no changes at all when i mess with the spawn chances...

 

Specifically i'm editing the militaryammo section of cfgloot to spawn in more ammo types for vehicles, but despite even taking out all others and just leaving the new one, it seems to be using default values regardless of my changes.

 

any idea what i might be doing wrong here?

 

EDIT: Well, it seems that i did indeed have it working, just not as i had hoped..

 

I was trying to get the Ammo Supply Box to include more ammunition types, but it seems to not pull from the militaryammo section at all, in fact, I got no clue as to where its getting its loot table from...anyone got any idea where it might be?

Link to comment
Share on other sites

  • 0

I have this working fine but the problems I am having on my server is that one of items I have set to what I thought was 1% seem to be spawning all over the place. Here is a quick look at how I have my sniper rifles set out.

 

sniperrifles[] = {
{
"AK_107_PSO",
"M4SPR",
"M40A3",
"SVD_CAMO",
"SVD_des_EP1",
"SVD",
"huntingrifle",
"M24_des_EP1",
"M24",
"BAF_LRR_scoped",
"M107_DZ",
"KSVK_DZE",
"VSS_vintorez",
"SCAR_H_LNG_Sniper_SD",
"M14_EP1",
"DMR",
"M110_NVG_EP1",
"SCAR_H_STD_EGLM_Spect"
},
{
0.07,
0.09,
0.09,
0.07,
0.07,
0.08,
0.09,
0.08,
0.07,
0.07,
0.05,
0.05,
0.04,
0.03,
0.02,
0.01,
0.01,
0.005
Link to comment
Share on other sites

  • 0

I've added the files, update the init and the description and all I'm getting is:
 

1:55:28 "DayZ Epoch: PRELOAD Functions\init [[<No group>:0 (FunctionsManager)],any]"
1:55:28 "DayZ Epoch: MPframework inited"
1:55:28 Error in expression <eight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 d>
1:55:28 Error position: <* 100);
for "_k" from 0 to _weight - 1 d>
1:55:28 Error *: Type String, expected Number
1:55:28 File z\addons\dayz_code\init\loot_init.sqf, line 75

 

Any tips?

Link to comment
Share on other sites

  • 0

if you got this error:

1:55:28 "DayZ Epoch: PRELOAD Functions\init [[<No group>:0 (FunctionsManager)],any]"
1:55:28 "DayZ Epoch: MPframework inited"
1:55:28 Error in expression <eight = round ((_itemChances select _l) * 100);
for "_k" from 0 to _weight - 1 d>
1:55:28 Error position: <* 100);
for "_k" from 0 to _weight - 1 d>
1:55:28 Error *: Type String, expected Number
1:55:28 File z\addons\dayz_code\init\loot_init.sqf, line 75

 

you are using the wrong files (probably the files from 1.0.5!)

Use these files:

https://github.com/vbawol/DayZ-Epoch/tree/Release_1.0.4.2/SQF/dayz_code/Configs/CfgBuildingLoot

Link to comment
Share on other sites

  • 0

1. Make a new folder in your mission file called "loottables". copy the hpp files from here https://github.com/vbawol/DayZ-Epoch/tree/master/SQF/dayz_code/Configs/CfgBuildingLoot into your loottable folder.

2. Open description.ext and add these lines just after the line that contains: "enableItemsDropping = 0;"

 

#include "loottables\CfgBuildingLoot.hpp"

3. Add DZE_MissionLootTable = true; to your init.sqf near the "// DayZ Epoch config" section.

 

*This is not for the lighthearted as much more documentation is needed for everyone to fully understand what everything does.

INSIDE YOUR VARIABLES.SQF LOCATE EITHER CODE 1.0.5.1 HAS THIS CODE IN MINE.

//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////

if (DZE_MissionLootTable) then {

    dayz_baseTypes =         getArray (missionConfigFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");

} else {

    dayz_baseTypes =         getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");

};

///////////////////////////////////////////////////////////////////////

AND THIS CODE WAS 1.0.4.2

//////////////////////////////////////////////////////////////////////

if (DZE_MissionLootTable) then {

    _config = missionConfigFile >> "CfgBuildingLoot";

} else {

    _config = configFile >> "CfgBuildingLoot";

};

//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////

ADDING DZE_MissionLootTable = true; to your init.sqf FILE.

 

THIS WILL MAKE THE SERVER CALL THAT LOCATION FROM YOUR VARIABLES.SQF!!!

 

SETTING THIS INSIDE description.ext  #include "loottables\CfgBuildingLoot.hpp" IS A DIFFERENT LOCATION TO THE FILE PATH

IF YOU SET THAT YOU NEED TO CHANGE THE LOCATIN IN VARIABLES.SQF

THE WAY THE CODE IS. THE LINE YOU ADD IT SHOULD BE #include "CfgBuildingLoot.hpp" SAME CALL TO FILE PATH AS SET IN VARIABLES

 

NOW #include "CfgBuildingLoot.hpp" MEANS THE FILE IS NOT IN A FOLDER JUST PUT IN YOUR MISSION FOLDER Where init.sqf AND description.ext files are!!

 

NOW EDIT "CfgBuildingLoot.hpp"

#include "cfgloot.hpp" MAKE SURE THIS IS AT THE TOP PUT THAT FILE IN THE SAME LOCATION AS "CfgBuildingLoot.hpp"

 

NOW EDIT "cfgloot.hpp"

#include "cfglootsmall.hpp" MAKE SURE THIS IS AT THE TOP PUT THAT FILE IN THE SAME LOCATION AS "CfgBuildingLoot.hpp" AND "cfgloot.hpp"

 

IF YOUR LOOT TABLES DONT HAVE IT AT THE TOP ADD EACH ONE TO YOUR description.ext

#include "loottables\CfgBuildingLoot.hpp"

#include "loottables\CfgLootSmall.hpp"

#include "loottables\cfgLoot.hpp"

REMEBER IF YOU USE A FOLDER CALLED loottables

YOU WILL NEED TO ADD THE FILE PATH TO YOUR VARIABLES.SQF

///////////////////////////////////////////////////////////

#include "CfgBuildingLoot.hpp"

#include "CfgLootSmall.hpp"

#include "cfgLoot.hpp"

USE THIS IF YOU JUST PUT THE FILES IN THE MISSION FOLDER WITH init.sqf AND description.ext

////////////////////////////////////////////////////////////

1.0.5.1 HAS THIS CODE IN MINE, EDITED FOR LOOTABLES FOLDER LOCATION FOR FILES

//////////////////////////////////////////////////////////////////////

if (DZE_MissionLootTable) then {

    dayz_baseTypes =         getArray (missionConfigFile >> "loottables\CfgBuildingLoot" >> "Default" >> "zombieClass");

} else {

    dayz_baseTypes =         getArray (configFile >> "loottables\CfgBuildingLoot" >> "Default" >> "zombieClass");

};

///////////////////////////////////////////////////////////////////////

AND THIS CODE WAS 1.0.4.2 EDITED FOR LOOTABLES FOLDER LOCATION FOR FILES

//////////////////////////////////////////////////////////////////////

if (DZE_MissionLootTable) then {

    _config = missionConfigFile >> "loottables\CfgBuildingLoot";

} else {

    _config = configFile >> "loottables\CfgBuildingLoot";

};

//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////

UPLOAD TO SERVER DONE!!!!!

 

WILL NOW LOAD PAST THE LOADING SCREEN AND INTO GAME

Link to comment
Share on other sites

  • 0

Would the leaked standalone serverfile loot be convertable over to the mod/epoch? to have the same loot positions as the standalone

Link to comment
Share on other sites

  • 0

Dansoe, your post is very hard to read with the capitalization and no code tags.

 

Can someone explain, in clear terms, how to use the custom loottables with 1.0.5.1? I've already gotten the files from here: https://github.com/vbawol/DayZ-Epoch/tree/master/SQF/dayz_code/Configs/CfgLoot

 

I just need to know how to call them. I tried this method, but it seems to keep all loot from spawning: 

 

I'm guess it has to do with file paths, as Dansoe tried explaining.

Link to comment
Share on other sites

  • 0

I can't Find "DZE_MissionLootTable" In my Init.sqf, I only have this:

 
// DayZ Epoch config
dayz_MapArea = 14000; // Default = 10000
DZE_teleport = [99999,99999,99999,99999,99999];
dayz_minpos = 0; 
dayz_maxpos = 16000;
DZE_BuildOnRoads = false; // Default: False

  
 

Link to comment
Share on other sites

  • 0

could anyone here explain how to increase the loot that spawns ??

in those files I see the chances but where do I set the quantity 

I hit 6 barracks and only 2 weapons spawned

also I killed 10 zombies and only one had loot

 

for example....

 

in my CfgBuildingLoot.hpp

 

class Military: Default {
zombieChance = 0.3;
maxRoaming = 6;
zombieClass[] = {"z_soldier","z_soldier_heavy","z_policeman"};
lootChance = 0.4;   increase this to 1 for 100% chance to spawn  max number of loot spawns ?? so may spawn alot of loot in each military class buildings
lootPos[] = {};
lootType[] = {
{ "pistols", "cfglootweapon", 0.04},  increase to .08 for better chance of it spawning pistols ??
{ "assaultrifles", "cfglootweapon", 0.13 },
{ "sniperrifles", "cfglootweapon", 0.04 },
{ "shotgunsingleshot", "cfglootweapon", 0.06 }
};
lootTypeSmall[] = {   is this the loot that the zombies from these buildings  spawn ??
{ "pistols", "cfglootweapon", 0.14 },
{ "Binocular", "weapon", 0.05 },
{ "ItemFlashlightRed", "weapon", 0.03 },
Link to comment
Share on other sites

  • 0
  • lootChance is the % chance that loot will spawn. 0.4 is 40%, change to 1 if you want it to spawn 100% of the time
  • { "pistols", "cfglootweapon", 0.04}, 0.04 is the % chance that the group (in this case pistols) will spawn, increase it for a higher % for pistols to spawn
  • lootTypeSmall is used for the different spawning positions within the building (usually shelves and things like that) that hold "smaller" loot items like bandages, soda, food, etc....
Link to comment
Share on other sites

  • 0

Loot pos is the distance from the center of that classnames model which makes it map independent. The central point of the building is [0,0,0] [x,y,z] the lootPos gives the distance of x,y,z from the center of that building to spawn the loot.  So long as the new map has the same kind of buildings, the same loot will spawn in the same spots inside that building.  If there are new buildings that do not have defined locations in your loot file they will not spawn loot.  However, epoch maps should all have the same buildings so you should be good.

Link to comment
Share on other sites

  • 0

Hi,

 

in the zombie_generate.sqf i missing the entry for missionconfigfile of cfgLoot.

 

 

//Add some loot
_loot = "";
_array = [];
_rnd = random 1;
if (_rnd < 0.2) then {
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
if (isText _lootType) then {
_array = [];
{
_array set [count _array, _x select 0]
} count getArray (configFile >> "cfgLoot" >> getText(_lootType));
if (count _array > 0) then {
_index = dayz_CLBase find getText(_lootType);
_weights = dayz_CLChances select _index;
_loot = _array select (_weights select (floor(random (count _weights))));
if(!isNil "_array") then {
_loot_count = getNumber(configFile >> "CfgMagazines" >> _loot >> "count");
if(_loot_count>1) then {
_agent addMagazine [_loot, ceil(random _loot_count)];
} else {
_agent addMagazine _loot;
};
};
};
};
};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...