Divide loot and remove existing from containers?Solved
Hi,
i have problems with these 2 configs:
"Divide Loot Into All Containers": true,
"Empty All Containers Before Spawning Loot": true,​

Both are buggy for me, but only in combination.
Only Containers are emptied, when the plugin puts Loot into them.
But: It does not really divide Loot into "all Containers".

With the newest Version, the plugin only uses cupboard, fridge & 1 (up to maximum 2 chests. but 8 out of 9 tries, it only used 1 chest (large wooden)).
All other chests are ignored (and not emptied. they still have their loot. )

"Empty All Containers Before Spawning Loot": true,

This will only empty the cupboard, large wooden box, small wooden box and coffins.

"Divide Loot Into All Containers": true,

This was created before moving items into the cupboard, fridge, bbq or oven was added. So if items are moved into these and not a box then the boxes will not have evenly divided loot. 

All other chests are ignored (and not emptied. they still have their loot. )

Those settings must be true in every profile, otherwise it will not empty their loot if its not

This will only empty the cupboard, large wooden box, small wooden box and coffins.

Ok, i re-tested and it works fine now.

This was created before moving items into the cupboard, fridge, bbq or oven was added. So if items are moved into these and not a box then the boxes will not have evenly divided loot. 

 

Not working for me :(
Ressources are moved to the cupboard: works
Consumables are moved to the fridge/bbq: works
All other items (about 20 items) are in one single large wooden box and all other large wooden boxes are empty.
/edit: or wait, do you mean it does NOT get divided, as long as i have cupboard+fridge?

Those settings must be true in every profile, otherwise it will not empty their loot if its not

I have set both settings in all 4 nivex.json

Post all of your files, including the config, via pastebin

Merged post

Also post a base in question
you don't have enough items. you want to spawn 100 but there aren't 100 to choose from

it also emptied all of the containers so i am not seeing an issue here :p

either add more items or allow duplicate items = true
Oh I updated my post before my last answer. Somehow in my tests while recording, the chests were emptied correctly. 
So the 100 items was the evil guy. We did not know how much items we would add to each list, so we changed it from 6 to 100.
If you are using this number for dividing, I have to set the number to the exact amount of items in my difficulty list, OK!

May I request a feature for the config to use the itemList.Count() dynamically besides the existing item amount config? 
May I request a feature for the config to use the itemList.Count() dynamically besides the existing item amount config? 

can you elaborate

Instead of using a static amount of "100" in the config, I would prefer to count the items from the loot table. 
So the item count would never be too much, or not enough. 
To be honest, I don't even know why I have to set the amount of items to spawn manually, when the list would already give the exact amount. 
well that wouldn't work when someone wanted more or less items in a specific base and that loot list (for example, Default Loot) was being used by more than 1 difficulty

also, that would remove the choices of items being random. it would literally spawn the same loot in the base every time. that's not good :p

as is, you can put 100 items in the loot list and put 50 to spawn and it'll always pick randomly from the 100 items
So, you won't add a config:
"Use amount of Items from the loaded list instead of static amount: false" 
With default false, so Noone gets confused. 
Just a thought :) 
but some would still get confused. so no :p

also, I enabled duplicate items and it only spawned 97 of 100. so it is still bugged slightly
OK, np :) 
Thank you very much for your fast replies and your help! 
Our players are so happy with this Plugin!
I will try again tomorrow with the correct amount of items in the config.
no prob

Merged post

ok, it spawned 97 out of 100 because 1 of your items has its amountMin set to 0. so if it randomly picks 0 then that item does not spawn. not a bug!

Merged post

I did completely rewrite divide loot to take into account the new settings for moving items into TC, BBQ, Fridge and ovens
Great, i will try the new version today.

...to get back to my former question. Maybe instead of a new config, you could 'change' the existing one?

From:
"Amount Of Items To Spawn": 100,​

To

"Amount Of Items To Spawn. (If set to 0 it will only spawn the amout of items defined in your loot tables)": 0,

:)))

Locked automatically