Page MenuHomeFeedback Tracker

random preset xml
Reviewed, NormalPublic

Description

hi, so since the update (1.26) ive noticed that when using a custom preset that when you kill a zombie lets say, ive made it so there should be around 10 items that the zombies can potnetially spawn with when a player kills them.

The preset seems to work but it only spawns the first item inside the dead zombies inventory, so in my case I made a preset caleld "ZombieLoot" and within that list it only spawns the can of peaches, It will not choose any other item and I know in with the previous versions that it use to randomly select an item within the preset list .

if i put a different item at the top of the list it will give that item as a loot reward when killing a zombie

Only thing ive changed within the file is making a new preset and changing all the zombies to have chance to include the cargo preset ive created

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
Server
Steps To Reproduce

tried changing different types loot, changing preset name.

tried changing % values to make other items more or less chnace of getting

Event Timeline

OneShot created this task.Oct 27 2024, 6:34 PM
Geez changed the task status from New to Need More Info.Tue, Oct 29, 12:27 PM
Geez added a subscriber: Geez.

Hello OneShot.
Please provide us with the modified file and your files from your mission folder.
Regards,
Geez



they are the only files ive changed that relates to causing my issue.

Geez added a comment.Wed, Oct 30, 1:00 PM

Hello OneShot.
We discovered that you had apparently calculated the chance incorrectly. There should be about 1.00 (100%) chance overall. You have set the 1.00 chance for PeachCan in your preset, meaning that the Infected will spawn the can with a 100% chance
Regards,
Geez

hi thankyou for gettign back to me, I will try change that a again but I have tried different % chnace on all items including lowering the chnace from 100%, I did have a different item at the top of the list above the Peaches can andthat had a 0.5% and it would also only spawn that item.

I will try again though, thanks. I will get back to you if it doesnt fix my issue

etwas added a subscriber: etwas.Thu, Oct 31, 2:20 AM

@OneShot: u used different naming for your preset.
in the cfgspawnabletypes.xml: <cargo preset="ZedLoot" />
but then in the cfgrandompresets.xml: name="ZombieLoot">
make sure to use the same name both files.

also u have to keep in mind that the infected only have 12 slots of inventory, so its quite impossible to get 10 items from a single zombie.

from your example:
<cargo chance="0.40" <- the general chance an item will spawn on a dead infected. here its 40%, so in theory nearly every 2nd infected will spawn something. when u want every infected to spawn something, set it to "1.00" (i recommend against it, u will flood in loot...)
and what item to spawn and its chance to do so, also from your example:

				<item name="PeachesCan" chance="1.0" />
				<item name="SodaCan_Cola" chance="1.0" />
				<item name="SodaCan_Pipsi" chance="1.0" />
				<item name="Matchbox" chance="0.5" />
				<item name="CanOpener" chance="0.5" />
				<item name="Rope" chance="0.5" />
				<item name="SewingKit" chance="0.5" />
				<item name="ChelatingTablets" chance="0.5" />
				<item name="Paper" chance="1.0" />
				<item name="BandageDressing" chance="1.0" />
				<item name="PurificationTablets" chance="0.5" />
                                <item name="Battery9V" chance="0.5" />
                                <item name="Flashlight" chance="0.5" />
				<item name="CharcoalTablets" chance="0.5" />
				<item name="PainkillerTablets" chance="0.5" />

theres 15 different items listed, which is fine, but you should lower that numbers, as storage will be occupied by all this items on the infected. even if u would just lower all cargo chances for the items to "0.1" each - in total it would still be a high 1.5 (15x0.1) chance; 150%. thats 3 items from 2 infected guaranteed (from the above 40% ones that spawn something.). in theory, dayz rolls the dice on every infected.
i hope this wasnt all too confusing^^

Geez changed the task status from Need More Info to Reviewed.Thu, Oct 31, 9:55 AM
OneShot added a comment.EditedThu, Oct 31, 2:02 PM

Oh i did use same name, I edited both files but reverted back when i sent my files for them to be checked out, I must have just forgot to chnage the 2nd file but I have made sure they do match.

from my testinglast night by lowering the %, it does see mto be working and I am gettign different items now

i have made all % chance now to 0.3, d oyou think thats still too high and should be 0.1 ?

I need to mess around with the overall % chance of zombies to spawn loot but essentially i want players needingto kill about 4-5 zombies before 1 of them has loot

Oh the reason why each item had a high % chnace was becasue ahwile ago I got told all of the items needed to equal 100% combined for them to spawn but I guess thats not the case.
so with the files ive sent for refference you can see al lthose 15 items will equal 100% just somethign that i was told awhile ago from the dayz Expansion Modders