Jump to content

question about loot tables

Pending 1.1.8

suicidemayhem
suicidemayhem

Posted (edited)

Question real quick. I have a file called basicguns.json where all items and categories are set to 0 except weapons at 100% and the following items.

machete	20
longsword	25
mace	25
wooden spear	80
stone spear	60
Knife	15
Bone knife	40
Bone club	30
salvaged sword	25
salvaged cleaver	25
crossbow	10
bow	25
eoka pistol	50
revolver	10
semi auto pistol	10
nailgun	30
double barrel	10
waterpipe	25

and i have it set to spawn 0-2 (because for some reason 0-1 never spawns anything)

,
    "crate_normal_2": {
      "enabled": true,
      "lootTable": "basicguns",
      "maxItems": 2,
      "minItems": 0,
      "gunsWithAmmo": true,
      "noGuns": false,
      "MaxBps": 0,
      "WaterPreFillPercent": 20,
      "ClearContainerFirst": false
    }

what is the percentage of the 0-2 items spawning? it seems it's very high, and if so I'd like to add a "blank" item essentially to cut down the spawn count, but when it does it selects from the above list at those pick numbers. it doesn't seem to matter if the weapons category is 5% or 100%, it still only picks from that category since all the others are 0.

i'd basically like to set a percentage that says "15% change of spawning an item, if yes, pick from the above list with those pick counts". can this be done with this plugin?

Edited by suicidemayhem
suicidemayhem

Posted

actually, i think it may work for me if i set the item count to min 0, max 1, but i get an error saying it can't find the item.

Failed to run a 1.00 timer in 'CustomLoot v1.1.5' (KeyNotFoundException: The given key was not present in the dictionary.)
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <eae584ce26bc40229c1b1aa476bfa589>:0
at Oxide.Plugins.CustomLoot.GetItem (Oxide.Plugins.CustomLoot+Settings settings, System.String category, System.Int32 BPs, System.String perma) [0x00088] in <3fdc45f4660843b5bb5765792aff6291>:0
at Oxide.Plugins.CustomLoot.MakeLoot (System.String config) [0x0024e] in <3fdc45f4660843b5bb5765792aff6291>:0
at Oxide.Plugins.CustomLoot+<PopulateContainer>c__AnonStorey2.<>m__1 () [0x0003d] in <3fdc45f4660843b5bb5765792aff6291>:0
at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <dfcb48ea05694263bbc08e62a39c274c>:0

If you'd be able to allow 0 count to "spawn", that might work for my situation.

 

  • Administrator
Steenamaroo

Posted (edited)

Hi,
Thanks for reporting - I'll chase up that error and see what the problem is.

"and i have it set to spawn 0-2 (because for some reason 0-1 never spawns anything)"

I think I see a mistake on my part there so I'll get that sorted too.

 

"i'd basically like to set a percentage that says "15% change of spawning an item, if yes, pick from the above list with those pick counts". can this be done with this plugin?"

In short, no. The plugin works on the basis that you're always going to get a specified amount of items,
and what those items are is worked out based on your set probabilities for category + item.

There's no real provision for enabling one item only and having it spawn in X percent of the time, I'm afraid.

The closest you could get is balancing your desirable item against some undesirable item,
so if you wanted a 1 in 5 chance of getting a c4, for example, maybe give them apples the other 4 times.

 

Just for clarity, the probability settings aren't percentages.
They're arbitrary numbers, balanced against each other.
That means there no maximum, and no fixed scale.

 

If you set all categories to 0 except for 
Food 1
Ammunition 9

then the given item will be food one time out of ten. (assuming both categories have an item enabled).

Setting Food 1000 and Ammunition 9000 would yield exactly the same result.

Edited by Steenamaroo
suicidemayhem

Posted

"Just for clarity, the probability settings aren't percentages.
They're arbitrary numbers, balanced against each other.
That means there no maximum, and no fixed scale."

yeah, thats why i called them "pick numbers", basically a lottery with higher numbers getting a higher chance of getting picked like the 1 vs 9 exampled you used.

 

so there is no way to spawn 0-1 item, so that there is some chance of even if the item is picked, you get 0 of it?

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.