Jump to content
  • 0

Zombie loot


SN1P3R

Question

20 answers to this question

Recommended Posts

  • 0

CfgLoot.hpp has the zombie classes:

	policeman[] = {
		{"ItemBandage",0.3}
		,{"7Rnd_45ACP_1911",0.08}
		,{"6Rnd_45ACP",0.08}
		,{"15Rnd_W1866_Slug",0.14}
		,{"8Rnd_B_Beneli_Pellets",0.16}
		,{"HandRoadFlare",0.07}
		,{"8Rnd_9x18_MakarovSD",0.01}
		,{"ItemComboLock",0.05}
		,{"SmokeShell",0.04}
		,{"FoodMRE",0.04}
		,{"ItemHotwireKit",0.03}
		,{"ItemDocument",0.02}
	};
Link to comment
Share on other sites

  • 0

using 1.0.5.1 and overpoch - Loot is spawning fine in building. But on the zombies barely any loot drops and when it does its not using the overpoch loot. Ive been thru the cfgloot.hpp file and everything is fine. Anyone able to help me get loot spawning properly on the zombies. Much appreciated. Event went to the extent of hashing out all the object that is meant to drop on zombies and leaving 1 object with a high rate of spawn and that still doesnt work.

Link to comment
Share on other sites

  • 0

Just replied to a PM about this.  You need to do the following to make epoch use the new mission files:

 

change:

} count getArray (configFile >> "cfgLoot" >> getText(_lootType));

to:

} count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));

edit: just want to say there's probably a bug in the default loot tables regarding zombies... Changing it over to my mission file defined loot tables seems to clear it up.  Also added a check to make sure that it logs issues if they are thrown.

 

 

Here's my whole zombie_generate.sqf

https://gist.github.com/deadfred666/49a26c8b1b47f89ed812

Link to comment
Share on other sites

  • 0

Hmm, i use the same mission file for two servere one overpoch and one vanialla epoch, kan i make this more dynamic ?

if (DZE_MissionLootTable) then {
   {
   _array set [count _array, _x select 0]
   } count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));
} else {
   {
   _array set [count _array, _x select 0]
   } count getArray (configFile >> "cfgLoot" >> getText(_lootType));
};

??

Link to comment
Share on other sites

  • 0

Hmm, i use the same mission file for two servere one overpoch and one vanialla epoch, kan i make this more dynamic ?

if (DZE_MissionLootTable) then {
   {
   _array set [count _array, _x select 0]
   } count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));
} else {
   {
   _array set [count _array, _x select 0]
   } count getArray (configFile >> "cfgLoot" >> getText(_lootType));
};

??

 

you should be able to do something like that.  Just make sure to validate your code works

Link to comment
Share on other sites

  • 0

Just replied to a PM about this.  You need to do the following to make epoch use the new mission files:

 

change:

} count getArray (configFile >> "cfgLoot" >> getText(_lootType));

to:

} count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));

edit: just want to say there's probably a bug in the default loot tables regarding zombies... Changing it over to my mission file defined loot tables seems to clear it up.  Also added a check to make sure that it logs issues if they are thrown.

 

 

Here's my whole zombie_generate.sqf

https://gist.github.com/deadfred666/49a26c8b1b47f89ed812

I do not have this file zombie_generate.sqf on my server? Could it be called something else or built into some other file. I made the changes above in my server_functions.sqf but it didn't seem to do anything at all. Here is how my server_functions.sqf looks for that part

 

// Add 0-3 loots to vehicle using random cfgloots

            _num = floor(random 4);

            _allCfgLoots = ["trash","civilian","food","generic","medical","military","policeman","hunter","worker","clothes","militaryclothes","specialclothes","trash"];

            

            for "_x" from 1 to _num do {

                _iClass = _allCfgLoots call BIS_fnc_selectRandom;

                _itemTypes = [];

                if (DZE_MissionLootTable) then{

                    {

                        _itemTypes set[count _itemTypes, _x select 0]

                    } count getArray (missionConfigFile >> "cfgLoot" >> _iClass);

                }

                else {

                    {

                        _itemTypes set[count _itemTypes, _x select 0]

                    } count getArray (missionconfigFile >> "cfgLoot" >> _iClass);

                };

                _index = dayz_CLBase find _iClass;

                _weights = dayz_CLChances select _index;

                _cntWeights = count _weights;

                

                _index = floor(random _cntWeights);

                _index = _weights select _index;

                _itemType = _itemTypes select _index;

                _veh addMagazineCargoGlobal [_itemType,1];

                //diag_log("DEBUG: spawed loot inside vehicle " + str(_itemType));

            };

            [_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;

Link to comment
Share on other sites

  • 0

In the zombie_generate.sqf file around line 90 change

        if (_rnd < 0.2) then {        to         if (_rnd < 0.65) then {   (or whatever percentage you want it to be)

 

And if you are using custom loot change at around line 95

 

} count getArray (ConfigFile >> "cfgLoot" >> getText(_lootType)); to this } count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));

Link to comment
Share on other sites

  • 0

In the zombie_generate.sqf file around line 90 change

        if (_rnd < 0.2) then {        to         if (_rnd < 0.65) then {   (or whatever percentage you want it to be)

 

And if you are using custom loot change at around line 95

 

} count getArray (ConfigFile >> "cfgLoot" >> getText(_lootType)); to this } count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));

See I don't have a zombie_generate.sqf, i found this array information in the AH.sqf here is what it looks like

 

    adminCallZeds =

    {

        fnc_addZeds =

        {

            _position = _this;

            for "_i" from 1 to 10 do

            {

                _unitTypes =     []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");

                _agent =     objNull;

                _type = _unitTypes call BIS_fnc_selectRandom;

                _radius = 40;

                _method = "NONE";

                _agent = createAgent [_type, _position, [], _radius, _method];

                _agent setVariable ["myDest",_position];

                _agent setVariable ["newDest",_position];

                _rnd = random 1;

                if (_rnd > 0.99) then

                {

                    _lootType = getText (configFile >> "CfgVehicles" >> _type >> "zombieLoot");

                    _lootTypeCfg = getArray (configFile >> "CfgLoot" >> _lootType);

                    _array = [];

                    {

                        _array set [count _array, _x select 0]

                    } count _lootTypeCfg;

                    if (count _array > 0) then

                    {

                        _index = dayz_CLBase find _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;

                            };

                        };

                    };

                };

                _id = [_position,_agent] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";

            };

        };

 

 

i changed this to .99 and they still don't drop crap

 

  if (_rnd > 0.99) then

                {

                    _lootType = getText (configFile >> "CfgVehicles" >> _type >> "zombieLoot");

                    _lootTypeCfg = getArray (configFile >> "CfgLoot" >> _lootType);

                    _array = [];

                    {

Link to comment
Share on other sites

  • 0

he already said what you need to do ;)

 

change this:

} count getArray (configFile >> "cfgLoot" >> getText(_lootType));

into 

} count getArray (missionConfigFile >> "cfgLoot" >> getText(_lootType));

and done 

Ok just dont get where LOL .. parden the retarded LOL, I put zombie_generate.sqf in custom compiles, that was posted .. that code not in that .. just trying to decipher what file needs edited

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
  • Discord

×
×
  • Create New...