Jump to content

The Return of the Zombie Loot


Kubikus

Recommended Posts

Just replacing the 2% chance zombie's currently have to drop something good with a 50% chance to drop junk. I'll probably work on this further to give zombies specific loot, tools and mats for the builder, meds for the nurse and so on.

 

Add this line to Localization.txt to have a proper label for the bag:

 

EntityLootContainerJunk,entityclasses,Entity Info,New,Dropped Loot (Junk),,,,,

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

The second archive contains a template for those who want one. It creates a lootcontainer (in loot.xml) and a dropped bag (in entityclasses.xml) for every zombie. It adds the bag for the "LootDropEntityClass"-property and it adds a "LootDropProb" for every zombie. Every lootcontainer just contains the lootgroup "junk", but you can edit it anyway you want to, fill the lootcontainer with items or lootgroups, change the drop rate, remove duplicates.

 

Edit: I have now started to populate the template with actual zombie specific loot, so some have something else but junk. Might not be balanced.

 

 

There is, however, another flaw in the xpath-approach: The ids for the lootcontainer:

 

<!-- cntMedicLootPile -->
<lootcontainer id="107" count="1,2" size="5,3" sound_open="UseActions/open_pill_case" sound_close="UseActions/close_pill_case" loot_quality_template="baseTemplate" destroy_on_close="true">
<item group="medicine"/>
</lootcontainer>

My lootcontainer start with id="108". If another xpath-mod would also use the id "108", the mods would not be compatible, only one would have the proper container.

 

Also: Here is a desc-list for localization.txt.

 

Here is another thing: I'm currently using the satchel as the dropped bag, you can use all kinds of containers, some I tried are:

 

//backpack_droppedPrefab

//loot_satchelPrefab

//duffle01Prefab

//sports_bag01Prefab

//sports_bag02Prefab

//backpack01Prefab

//backpack03Prefab

//backpack02Prefab

//AmmoPiles_LargePrefab

//medic_loot_pile_APrefab

 

Some, however, seem pretty restless, once they start rolling, they hardly ever stop. Satchel is fine, vanilla's bag is "backpack_droppedPrefab".

Kubikus Zombie Loot Template.zip

Kubikus Zombie Loot.zip

Link to comment
Share on other sites

Nice. Is it possible to let the zds have a chance of dropping two or more bags?
No. But why would you want two bags? You can put anything you want from loot in one bag. You could also give the junk-bag a chance to be vanilla's good stuff bag.

 

Also, I edited the op, to have a proper label for the bag. I guess you can't use xpath to edit Localization.txt? Flaw!

Link to comment
Share on other sites

No. But why would you want two bags? You can put anything you want from loot in one bag. You could also give the junk-bag a chance to be vanilla's good stuff bag.

 

Also, I edited the op, to have a proper label for the bag. I guess you can't use xpath to edit Localization.txt? Flaw!

 

nope no Localization

 

And with RH Localization heavy its why i stopped using xpath. Which is a shame :( I liked it a LOT

Link to comment
Share on other sites

nope no Localization

 

And with RH Localization heavy its why i stopped using xpath. Which is a shame :( I liked it a LOT

I assume it will be "fixed" sometime, no reason not to use it. It's already great because you don't have to quit the whole programm for every change you want to test, just stop and re-start the save.

 

Looks like 199 upped it from base .02 and .03 for ferals to .03 for all. Would a simple mass replace of "LootDropProb" value=".03" to "LootDropProb" value=".25" in entityclasses.xml change it or is there something else that needs to be changed?

 

Thanks

You can simply increase the chance for the drops with that number, yeah, but what vanilla drops is pretty good stuff, getting such a bag from every fourth zombie you kill is kinda too much; personally I find it too good even with the low chance it currently has. Some zombies still drop it, btw, at least the Hawaiian.

 

Anyways, this mod will drop bags with "junk", pretty much what the trash mobs dropped in A16. I'll expand it to zombie-type-specific loot, when I actually start some serious modding.

Link to comment
Share on other sites

Honestly I feel 25% would be abit more balanced than the 50%
Oh hey, I didn't see you there. Well, it's only junk and junk for every type, so so far I can say it's alright. Will adjust when I get more type-specific loot in; still playing mainly and only modding every now and then.

 

- - - Updated - - -

 

At some point the forum is going to decide you have too many attachments, so you'll want a real file host kub.

 

Github or gitlab is your best bet.

Damn this complicated life... Thanks for the heads up, tho, will cross that bridge when I have to.

 

 

Edit: I am just noticing a major flaw of the mod, wherever a zombie has no loot-drop-probability of it's own, but a dropped container of it's own, it drops that container with a 50% chance. Like here:

 

<entity_class name="zombieBiker" extends="zombieTemplateMale">
<property name="Tags" value="zombie,walker"/>
<property name="Mesh" value="Zombies/zombieStandardBikerRagdoll"/>
<property name="Mass" value="230"/>
<property name="WalkType" value="7"/>
<property name="PainResistPerHit" value=".75"/>

<!-- Gameplay -->
<property name="HandItem" value="meleeHandZombieStrong"/>
<property name="ExperienceGain" value="1200"/> <!-- XP strong -->
<property name="LootDropEntityClass" value="EntityLootContainerStrong"/>
<effect_group name="Base Effects">
	<passive_effect name="HealthMax" operation="base_set" value="300"/>
	<passive_effect name="HealthMax" operation="perc_add" value="0"/> <!-- Zombie HP scale -->
	<passive_effect name="PhysicalDamageResist" operation="base_add" value="20"/>
</effect_group>
</entity_class>

It will drop the EntityLootContainerStrong-bag with a 50% chance. Will fix that... soon. Weekend.

Link to comment
Share on other sites

Is there a way to make it still drop the good loot 2 - 3% of the time and the junk as well?
This might work; haven't tested it. I'm particularly uncertain if the probability-values work like this, vanilla sometimes uses kinda weird values. Is "0.98" actually the 98% chance..?

 

Try it out, replace everything that is in the loot.xml (of the xpath-mod) with this:

 

<configs>
<insertAfter xpath="/lootcontainers/lootgroup[@name='BuriedStashChest']" >
<lootgroup name="A17drops">
<item group="cannedfood" count="1,2" prob="2"/>
<item name="drinkJarBeer" count="1,3" prob=".8"/>
<item name="drinkJarBoiledWater" count="1,4" prob="1.5"/>
<item group="books" prob="1"/>
<item name="resourceCandleStick" count="1,2" prob="1"/>
<item name="resourceForgedIron" count="1,8" prob="0.5"/>
<item name="resourceForgedSteel" count="1,8" prob="0.5"/>
<item group="tools" prob="1"/>
<item group="rareTools" prob=".5"/>
<item group="ironArmor" prob=".5"/>
<item group="steelArmor" prob=".3"/>
<item group="militaryArmor" prob=".3"/>
<item group="clothes"/>
<item group="warmClothes" prob=".3"/>
<item group="ammo" prob="2"/>
<item group="weaponsPistol+ammo" prob="0.8"/>
<item group="weaponsMagnum+ammo" prob="0.15"/>
<item group="weaponsAnyShotguns+ammo" prob=".8"/>
<item group="weaponsHuntingRifle+ammo" prob=".5"/>
<item group="weaponsMilitaryGuns+ammo" prob=".15"/>
<item name="gunCompoundBow" prob="0.4"/>
<item name="nightvisionGoggles" prob="0.2"/>
<item name="casinoCoin" count="10,110" prob="1"/>
<item name="oldCash" count="20,100"/>
<item name="drugHerbalAntibiotics" count="1,2" prob="0.2"/>
<item group="rareMedicine" prob="0.3"/>
<item name="drugPainkillers" count="1,2" prob=".5"/>
<item name="drugVitamins" count="1,2" prob=".7"/>
<item group="treasureMaps" count="1" prob="0.1"/>
<item group="questChallenge" count="1" prob="0.1"/>
</lootgroup>
</insertAfter>

<append xpath="/lootcontainers" >
<lootcontainer id="108" count="1,2" size="6,2" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="baseTemplate">
<item group="junk" count="0.98"/>
<item group="A17drops" count="0.02"/>
</lootcontainer>
</append>
</configs>

Link to comment
Share on other sites

Nice, saved me a bit of work doing this myself. I ended up setting the drop chance to 20% (10x vanilla value) then re-adding the vanilla good loot and reducing their probability by 10x (to make up for the increased chance of the container dropping). Increased the container count and size a tad too. Pasted the code below, haven't done much testing yet and I'm not sure how count 1,3 will affect the chance of junk spawning. It may be that it picks 1-3 individual items at random, then rolls the probability, which means it may make junk more rare which isn't what I want.

 

<lootcontainer id="108" count="1,3" size="6,4" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="baseTemplate">
<item group="junk" count="1"/>
<item group="cannedfood" count="1,2" prob="0.2"/>
<item name="drinkJarBeer" count="1,3" prob=".08"/>
<item name="drinkJarBoiledWater" count="1,4" prob=".15"/>
<item group="books" prob="0.1"/>
<item name="resourceCandleStick" count="1,2" prob="0.1"/>
<item name="resourceForgedIron" count="1,8" prob="0.05"/>
<item name="resourceForgedSteel" count="1,8" prob="0.05"/>
<item group="tools" prob="0.1"/>
<item group="rareTools" prob=".05"/>
<item group="ironArmor" prob=".05"/>
<item group="steelArmor" prob=".03"/>
<item group="militaryArmor" prob=".03"/>
<item group="clothes"/>
<item group="warmClothes" prob=".03"/>
<item group="ammo" prob="0.2"/>
<item group="weaponsPistol+ammo" prob="0.08"/>
<item group="weaponsMagnum+ammo" prob="0.015"/>
<item group="weaponsAnyShotguns+ammo" prob=".08"/>
<item group="weaponsHuntingRifle+ammo" prob=".05"/>
<item group="weaponsMilitaryGuns+ammo" prob=".015"/>
<item name="gunCompoundBow" prob="0.04"/>
<item name="nightvisionGoggles" prob="0.02"/>
<item name="casinoCoin" count="10,110" prob="0.1"/>
<item name="oldCash" count="20,100" prob="0.1"/>
<item name="drugHerbalAntibiotics" count="1,2" prob="0.02"/>
<item group="rareMedicine" prob="0.03"/>
<item name="drugPainkillers" count="1,2" prob=".05"/>
<item name="drugVitamins" count="1,2" prob=".07"/>
<item group="treasureMaps" count="1" prob="0.01"/>
<item group="questChallenge" count="1" prob="0.01"/>
</lootcontainer>

Link to comment
Share on other sites

Hi, change lootcontainer groups from count to prob :)

<lootcontainer id="108" count="1,2" size="6,2" destroy_on_close="false" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1" loot_quality_template="baseTemplate">
<item group="junk" prob="0.98"/>
<item group="A17drops" prob="0.02"/>
</lootcontainer>

 

and a typo (extra ") at the top

<lootgroup name="A17drops">

Link to comment
Share on other sites

I did a rework of a middle ground between A16.4 and A17 loot drops. Most zombies have their loot lists changed back to what they were in A16.4 with updated item names, eg. farmers drop hoes and seeds, snow zombies drop fireaxes, cops drop flashlights/guns/vests, etc. But most ferals now drop their A17 loot albeit at a lower probability and a lowered count of 1,3 from 2,3 since the universal drop probability is higher. Also all item ids start at 200 to avoid problems with patches. Seems to work fairly well so far, going to do a little more testing then I can post the code for you to throw in your mod or whatever if you're interested.

Link to comment
Share on other sites

the entityclasses has loot container id 108, and the loot xml has it as 111. so change the 108 to 111

 

from

<property name="LootListOnDeath" value="108"/>

 

to

<property name="LootListOnDeath" value="111"/>

 

that should work.

Alright, now it's fixed. I'm not using that basic mod myself, but the "template". I hope they will get rid of the numeric ids, cuz Murphy's law is a god damn bitch.
Link to comment
Share on other sites

I did a rework of a middle ground between A16.4 and A17 loot drops. Most zombies have their loot lists changed back to what they were in A16.4 with updated item names, eg. farmers drop hoes and seeds, snow zombies drop fireaxes, cops drop flashlights/guns/vests, etc. But most ferals now drop their A17 loot albeit at a lower probability and a lowered count of 1,3 from 2,3 since the universal drop probability is higher. Also all item ids start at 200 to avoid problems with patches. Seems to work fairly well so far, going to do a little more testing then I can post the code for you to throw in your mod or whatever if you're interested.
I'm growing reluctant to make it that simple, because with the reduced loot drops, the devs designed other loot so that it's richer. Mostly junk seems kinda reasonable for all non feral and non radiated (and non legendary) zombies. Type specific junk seems a good idea. Feral and radiated have a 100% chance to drop something, plus a chance to drop something real good.

 

As for the ID, I'm using a self-made script for modding, it grabs and sets the ID automatically, I just didn't notice because I'm using the "template", not the quick fix. There also is an upper limit of lootlists, I think 255 (aka 256), at least in A16.

Link to comment
Share on other sites

It is a bit different also because the A16.4 drops had count 0,2 which I assume means they can drop between 0-2 items, but every zombie dropped a lootable corpse, whereas here it's a chance to drop a lootable object. I don't know if I like the idea of zombies dropping backpacks everywhere many of which are empty. Goes back to time wasted on empty corpses.

 

Also I don't think the prob value is a percentage, because there are items with probs higher than 1, some going up to 40 even. It's a weighted system which I believe works like, say you have junk prob=10 and cannedfood prob=2. It would have an equal chance of picking one out of the following:

 

junk junk junk junk junk junk junk junk junk junk cannedfood cannedfood

 

So a 10/12 chance (83.3%) of picking junk and 2/12 chance (16.6%) of picking cannedfood.

 

But that poses a few questions: Is an item with no prob value defaulted to 1, and if so why are there items with prob="1"?

 

Edit: Though, I guess if you have 2 items one set to 0.98 (or 98) and one set to 0.02 (or 2), that would work out to 98% vs 2%

Link to comment
Share on other sites

It is a bit different also because the A16.4 drops had count 0,2 which I assume means they can drop between 0-2 items, but every zombie dropped a lootable corpse, whereas here it's a chance to drop a lootable object. I don't know if I like the idea of zombies dropping backpacks everywhere many of which are empty. Goes back to time wasted on empty corpses.

 

Also I don't think the prob value is a percentage, because there are items with probs higher than 1, some going up to 40 even. It's a weighted system which I believe works like, say you have junk prob=10 and cannedfood prob=2. It would have an equal chance of picking one out of the following:

 

junk junk junk junk junk junk junk junk junk junk cannedfood cannedfood

 

So a 10/12 chance (83.3%) of picking junk and 2/12 chance (16.6%) of picking cannedfood.

 

But that poses a few questions: Is an item with no prob value defaulted to 1, and if so why are there items with prob="1"?

 

Edit: Though, I guess if you have 2 items one set to 0.98 (or 98) and one set to 0.02 (or 2), that would work out to 98% vs 2%

I don't really know how those prob-numbers work, never took the time to experiment with it, but I also notice that some values in vanilla are > 1. Maybe that's some sort of internal indicate (like "if that number equals 10, do a special thing"). As a rule of thumb, 0.1 = 10%, 0.5 = 50% and 1 = 100% seems to work good enough.

 

Empty drops from zombies should not come back, pre A17 I had modded it so that zombies always drop (exactly) one item, so I like the change that they drop a bag and only when something is in it.

 

However, with quests you get quite a lot of really good loot, so I'm thinking that normal zeds only should drop junk, but for aesthetics zombie specific. Like a nurse has a high chance to drop a painkiller or bandage or cloth, a banker old cash or paper, utility worker nails and wood, etc. And the stronger/faster types always drop something and get a chance for good stuff, like medical bandage or ("even") a med kit for the feral nurse, nuggets for the banker, tools for the worker.

Link to comment
Share on other sites

I did some brief testing, set junk to prob=20 and resourceCoal to prob=20. Only items in loot pool. Was getting each at about a 50/50 ratio. I'm like 90% sure that is how it works, it adds all numbers together and each item is represented as many times as its probability value. To get the actual percentage value you take the individual item and divide its probability value by the total of all probability values in the pool. According to XML.txt armor degradation works the same as loot probability. Still don't know what happens when an item has no prob value attached to it though, I assume it just represents itself once when the RNG roll happens. However if you do it where each item is a decimal and all in the pool add up to 1 (or integers that add up to 100), that will effectively make it = to the percentage. eg,

 

junk prob="50"

cannedfood prob="30"

bandage prob="10"

medkit prob="10"

 

That all adds up to 100

 

junk 50/100 = 50%

cannedfood 30/100 = 30%

bandage 10/100 = 10%

medkit 10/100 = 10%

 

Edit: This is of course not including loot groups, which have their own weighted probabilty nested within. So if you have lootgroup junk which contains:

 

cannedfood: 0.5

boiledwater: 0.5

(total = 1)

 

And another container which contains:

 

lootgroup junk: 0.5

bandage: 0.5

(total = 1)

 

That results in an actual 50% chance to get bandage, 25% cannedfood, and 25% boiledwater.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...