Jump to content
  • 0

Need some help with loot error in client log


BetterDeadThanZed

Question

I've got custom loot tables installed and the loot seems to be spawning appropriately, but I'm getting this error in my client log that I believe is related to my custom loot tables:

Error in expression <) select 2) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k>
  Error position: <_weight - 1) do
{
_weighted set [_j + _k>
  Error Undefined variable in expression: _weight
File z\addons\dayz_code\init\loot_init.sqf, line 27

The error repeats 7 times.  The loot_init.sqf is the standard file. I haven't edited it, so something in my loot tables must be causing this error. In case anyone wants to take a look, here's my loot table files: https://www.dropbox.com/s/fnbbeo7mxl4y6j0/loot.rar?dl=0

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

it's something rather big that you've placed in lootsmall portion of spawning, for me it was bigger weapons than sidearms and possibly vehicle ammo

 

Edit: Let's say for example this first one is perfectly fine and working

class MilitarySpecial: Default{
zombieChance=0.4;
minRoaming=2;
maxRoaming=6;
zombieClass[]={"z_soldier_heavy"};
lootChance=1;
lootPos[]={};
lootType[]={{"assaultrifles","cfglootweapon",0.14},{"machineguns","cfglootweapon",0.04},{"pistols","cfglootweapon",0.08},{"sniperrifles","cfglootweapon",0.03},{"militaryshotguns","cfglootweapon",0.05},{"submachinegun","cfglootweapon",0.06},{"AmmoBoxSmall_556","object",0.01},{"AmmoBoxSmall_762","object",0.02},{"ItemGPS","weapon",0.01},{"Binocular_Vector","military",0.01},{"militarybackpacks","militarybackpacks",0.04},{"","medical",0.08},{"","military",0.01},{"machinegunammo","machinegunammo",0.2},{"militaryclothes","militaryclothes",0.04},{"militaryammo","militaryammo",0.02}};
lootTypeSmall[]={{"pistols","cfglootweapon",0.2},{"AmmoBoxSmall_556","object",0.02},{"AmmoBoxSmall_762","object",0.02},{"ItemGPS","weapon",0.02},{"Binocular_Vector","weapon",0.03},{"","medical",0.08},{"","generic",0.15},{"","military",0.33},{"5Rnd_86x70_L115A1","magazine",0.03},{"10Rnd_127x99_m107","magazine",0.02},{"machinegunammoexpl","single",0.02},{"militaryclothes","single",0.11},{"NVGoggles","weapon",0.04},{"100Rnd_762x54_PK","magazine",0.02}};
};

However this 2nd one will give you that or similar error

class MilitarySpecial: Default{
zombieChance=0.4;
minRoaming=2;
maxRoaming=6;
zombieClass[]={"z_soldier_heavy"};
lootChance=1;
lootPos[]={};
lootType[]={{"assaultrifles","cfglootweapon",0.14},{"machineguns","cfglootweapon",0.04},{"pistols","cfglootweapon",0.08},{"sniperrifles","cfglootweapon",0.03},{"militaryshotguns","cfglootweapon",0.05},{"submachinegun","cfglootweapon",0.06},{"AmmoBoxSmall_556","object",0.01},{"AmmoBoxSmall_762","object",0.02},{"ItemGPS","weapon",0.01},{"Binocular_Vector","military",0.01},{"militarybackpacks","militarybackpacks",0.04},{"","medical",0.08},{"","military",0.01},{"machinegunammo","machinegunammo",0.2},{"militaryclothes","militaryclothes",0.04},{"militaryammo","militaryammo",0.02}};
lootTypeSmall[]={{"assaultrifles","cfglootweapon",0.14},{"machineguns","cfglootweapon",0.04},{"pistols","cfglootweapon",0.2},{"AmmoBoxSmall_556","object",0.02},{"AmmoBoxSmall_762","object",0.02},{"ItemGPS","weapon",0.02},{"Binocular_Vector","weapon",0.03},{"","medical",0.08},{"","generic",0.15},{"","military",0.33},{"5Rnd_86x70_L115A1","magazine",0.03},{"10Rnd_127x99_m107","magazine",0.02},{"machinegunammoexpl","single",0.02},{"militaryclothes","single",0.11},{"NVGoggles","weapon",0.04},{"100Rnd_762x54_PK","magazine",0.02}};
};

P.S. Ignore spawn rate numbers as this is just an example of the problem

Link to comment
Share on other sites

  • 0

I've got custom loot tables installed and the loot seems to be spawning appropriately, but I'm getting this error in my client log that I believe is related to my custom loot tables:

Error in expression <) select 2) * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted set [_j + _k>
  Error position: <_weight - 1) do
{
_weighted set [_j + _k>
  Error Undefined variable in expression: _weight
File z\addons\dayz_code\init\loot_init.sqf, line 27

The error repeats 7 times.  The loot_init.sqf is the standard file. I haven't edited it, so something in my loot tables must be causing this error. In case anyone wants to take a look, here's my loot table files: https://www.dropbox.com/s/fnbbeo7mxl4y6j0/loot.rar?dl=0

 

I also have a similar error in my client  RPT when in my servers. Seems to not cause any problems.

 

This is the one i get

Error in expression <ind _iItem;
_weights = dayzE_CLSChances select _index;
_cntWeights = count _weig>
  Error position: <select _index;
_cntWeights = count _weig>
  Error Zero divisor
File z\addons\dayz_code\compile\spawn_loot_small.sqf, line 81

I get this one also. Guessing it has something to do with loot table also.

Error in expression <tNumber(configFile >> "CfgMagazines" >> _loot >> "count");
if(_loot_count>1) the>
  Error position: <_loot >> "count");
if(_loot_count>1) the>
  Error Undefined variable in expression: _loot
File z\addons\dayz_code\compile\zombie_generate.sqf, line 100
Error in expression <CLChances select _index;
_loot = _array select (_weights select (floor(random (c>
  Error position: <select (_weights select (floor(random (c>
  Error Zero divisor
File z\addons\dayz_code\compile\zombie_generate.sqf, line 98

Also this one

Error in expression < getVariable["actionSet", false];

if (!_actionSet) then {
s_player_holderPickup>
  Error position: <_actionSet) then {
s_player_holderPickup>
  Error Undefined variable in expression: _actionset
File z\addons\dayz_code\init\object_BackpackAction.sqf, line 13

These pop up a couple times and go away. Kinda ignored them to be honest.

Link to comment
Share on other sites

  • 0

check your config files. loot.hpp and smallloot.hpp. also worth a check is buildinglootpos.hpp. you might have messed up something there. the actionset error has nothing to do with it. its a common epoch 1051 error.

 

What am I looking for? The server loads and loot spawns, which means that it's working. I checked my small loot and there's nothing larger than a pistol or pistol ammo there. 

Link to comment
Share on other sites

  • 0

There was one of arma patches that started doing this a while ago, that's why some older scripts are getting it. Back then engine didn't care much about variable defines when accessing them for some reason.

So that's what exactly happens - variable was not defined when accessed with .. lets say if statement. After that variable was defined/set... which allowed script to function after a single error.

Solution is simply to define variable early.. usual defines are empty stuff like 0, [], false, ""... depending on var type.. you get the idea.

Link to comment
Share on other sites

  • 0

the error I had myself several times when I chanfed something in these files. But I fixed it. check your lootfiles for weapons that spawn within a magazine array. (toolbeltitems etc.). or, zeds spawning weaponitems (which is not possible for them). could be anything. the lootspawn files are very nasty sometimes.

Link to comment
Share on other sites

  • 0

the error I had myself several times when I chanfed something in these files. But I fixed it. check your lootfiles for weapons that spawn within a magazine array. (toolbeltitems etc.). or, zeds spawning weaponitems (which is not possible for them). could be anything. the lootspawn files are very nasty sometimes. else start with fresh lootfiles and make your edits again.

 

So the cfgloot and cfglootsmall files would be where I'd look for errors in the zombie's loot?

Link to comment
Share on other sites

  • 0

yes. the zombieloot tables are the following ones:

        zombieLoot = "civilian";
        zombieLoot = "policeman";
        zombieLoot = "office";
        zombieLoot = "office2";
        zombieLoot = "medical";
        zombieLoot = "civilian";
        zombieLoot = "hunter";
        zombieLoot = "military";
        zombieLoot = "militarypilot";
        zombieLoot = "civilian";
        zombieLoot = "worker";

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...