How to change (dead) Zombie Loot?

DonProtz

New Member
I am running a Bliss/Reality Server and i tried to change the Loot from the Zombies in the cfgLoot.hpp because i found this piece of code in the zombie_generate.sqf. But I didnt seen any changes.
What do you think? Thx
Greeetings Don Protz

Codeline from the zombie_generate.sqf:

//Add some loot
_rnd = random 1;
if (_rnd > 0.3) then {
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
if (isText _lootType) then {
_array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
if (count _array > 0) then {
_loot = _array call BIS_fnc_selectRandomWeighted;
if(!isNil "_array") then {
_agent addMagazine _loot;
 
To change this you need to override the files CfgVehicles and cfgLoot. It's a case of changing the command to "missionconfigfile" from "configFile" This has to be done here and also I believe you would have to override the "spawn_loot.sqf" via your compiles file and again change the values in that file to "missionconfigfile" and have your cfgLoot/vehicls etcin the root of your mission file :)
 
Hey thx for your answer Rossymond, would be keen if you can explain it for stupid people like me. I dont get it really what to do. Thx again for your time, perhaps you can make a tutorial for this....
 
You could also just build a simple array of the loot you want zeds to spawn select from it at random for the loot for each zed. No need to mess about with config files, but you'll be editing zombie_generate quite a bit, and overriding it in the mission.
 
From my zombie_generate - to make zeds spawn with skins from my addon. Just replace the _loot array contents with what you want zeds to have (no weapons)

Code:
_rnd = random 1;
if (_rnd > 0.3) then {
_loot = ["Skin_Bandit2_DZ","Skin_GUE_Soldier_MG_DZ","Skin_GUE_Soldier_Sniper_DZ","Skin_GUE_Soldier_Crew_DZ","Skin_GUE_Soldier_CO_DZ","Skin_GUE_Soldier_2_DZ","Skin_Rocket_DZ","Skin_RU_Policeman_DZ","Skin_Pilot_EP1_DZ","Skin_Haris_Press_EP1_DZ","Skin_Ins_Soldier_GL_DZ","Skin_GUE_Commander_DZ","Skin_Functionary1_EP1_DZ","Skin_Priest_DZ","Skin_Rocker1_DZ","Skin_Rocker2_DZ","Skin_Rocker3_DZ","Skin_Rocker4_DZ","Skin_TK_INS_Warlord_EP1_DZ","Skin_TK_INS_Soldier_EP1_DZ","Skin_CZ_Special_Forces_GL_DES_EP1_DZ","Skin_Drake_Light_DZ","Skin_Soldier_Bodyguard_AA12_PMC_DZ","Skin_Soldier_Sniper_PMC_DZ","Skin_Soldier_TL_PMC_DZ","Skin_FR_OHara_DZ","Skin_FR_Rodriguez_DZ","Skin_CZ_Soldier_Sniper_EP1_DZ","Skin_Graves_Light_DZ"] select floor random 29;
//    _lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
//    if (isText _lootType) then {
//        _array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
//        if (count _array > 0) then {
//            _loot = _array call BIS_fnc_selectRandomWeighted;
//            if(!isNil "_array") then {
                _agent addMagazine _loot;
//            };
//        };
//    };
};
 
Thx a lot mmmyum, is it possible to add a chance in % for each loot??
Think it would be
Code:
 if  (_rnd > 0.3 then {
maybe?
EDIT: Actually I believe it is randomised, there is no fix percentage of the chance of loot....

Someone correct me I'm lost :(
 
Haha CommanderRetra, you almost had it!!

The code you quoted, with _rnd, gives approx 60% chance to have the zed spawn loot.

But you are right, it selects at random - this part: | select floor random 29 | is what picks from the array at random.

Yes it is possible to do weighted loot chances, but you'll have to look into it more yourself. Check the biki for weighted loot arrays, or dig into the loot gen code as it is and see how they do it. I think there might even be a BIS_fnc for it. Good luck.
 
Back
Top