Serverside Loot

delpi

Well-Known Member
I believe that loot is now handed serverside for 1.8.2 forward.

Has anyone played around withadjusting it serverside?

I think i want to decreasethe loot chances of weapons and such. I'll probably play around wih it this week, but didn't wantt start from scratch if someone else had looked into it.
 
its optional whether you want serverside or clientside. I havent ventured to examine that yet but the loot tables and spawn chances should be identical, its just whether you want the server to spawn the loot or not.
A word of advise. Be VERY careful when adjusting the loot tables, it is SOOOO easy to make a mistake and then nothing works. Make a backup every time you test it working and take slow steps.

This is as good a place as any to explain how the loot chances work (I am sure someone is interested).
Code:
            {"ItemMatchbox_DZE","weapon",0.01},
            {"ItemKnife","weapon",0.02},
            {"ItemMap","generic",0.01},
            {"ItemCompass","weapon",0.02},
            {"ItemFlashlight","weapon",0.01},
Those numbers are the chances for an item to spawn, it does NOT mean 1% or 2% though. Imagine a hat where you toss in pieces of paper with names of the items and then randomly draw one piece of paper. Now suppose you want one item to have a higher chance of being drawn so you write its name down on 3 pieces of paper and add those to the hat. That is how those chances work. The random select function creates an array that contains all the items. If it has a .01 then that name is added to the array 1 time, if it has a .02 then that item is added to the array twice, if it were .06 then that item would be added to the array 6 times. And then the function simply selects an index of the item to select, the more times an items name is in the array, the more likely it is to be selected.
So the above code block would result in an array like this:
[itemmatchbox_dze, itemknife, itemknife, itemmap, itemcompass, itemcompass, itemflashlight].
So doing the math, a matchbox would have a 1 in 7 chance of appearing (14%) while a knife would have a 2 in 7 chance (28%). Remember that these actual items are also in an array of 'loot types' that are chosen first (military, trash, residential etc) using the same method.
 
Back
Top