Bowabos

CustomLoot oil_barrel test

Pending 1.0.4

CustomLoot does not seem to take into account config. Trying to get started, so picked up oil_barrel as an example...

Edit oxide\config\CustomLoot.json:

    "oil_barrel": {
      "enabled": true,
      "lootTable": "oil_barrel",
      "maxItems": 6,
      "minItems": 6,
      "gunsWithAmmo": false,
      "noGuns": false,
      "MaxBps": 3,
      "MinWeaponCondition": 50,
      "MaxWeaponCondition": 50,
      "ClearContainerFirst": true
    },

Tried also "ClearContainerFirst": false (I would expect that I would have normal loot + what is in CustomLoot in this case)...

Moreover edit oxide\data\CustomLoot\oil_barrel.json (which was auto created)

  "AlwaysSpawnList": [
    "jackhammer"
  ],

+ Removed from BlackList

To check if I'll get a jackhammer...

 

in server console: oxide.reload CustomLoot

Unloaded plugin CustomLoot v1.0.4 by Steenamaroo

Loaded plugin CustomLoot v1.0.4 by Steenamaroo

Calling 'OnServerInitialized' on 'CustomLoot v1.0.4' took 348ms

[CustomLoot] Finished populating all containers.

In game, break an oil_barrel (red one with usually crude+oil)... I get the default spawn (crude+oil).

Tried spawning a new oil_barrel too.

 

I'm probably doing something stupid somewhere...

Thanks in advance for your help...

Edited by Bowabos

Share this comment


Link to comment

Apologies, please close the ticket.

 

Possibly formalising the question helped me.

I tried instead to put some probabilities to 100% and managed to get what I want.

Not sure how I would use the AlwaysSpawnList but I don't need it so don't waste time on this...

Share this comment


Link to comment

Glad you got sorted.
Worth pointing out, though, that probabilities aren't percentages. It's a two-tier relative system.

For each spawned item a category is chosen first, based on your category probabilities,
then once a category is picked one item from that category is chosen using the item probabilities.

 

For a simple example, if there were 10 categories and you set their probabilities all to 10 except for one, which you set to 1,
then there's a 1 in 91 chance of the rare category being picked.

 

I generally recommend people set all item and category probabilities to some sensible middle-ground number, like 10,
then adjust certain categories and items up/down around that to taste.

 

Always spawn list is there so you can guarantee some item without messing up probabilities for the other items in its category.

A lot of people want scrap to always spawn along side randomised loot, for example.

 

  • Thanks 1

Share this comment


Link to comment

OK I think I may have got it.

If my container has "maxItems": 6, "minItems": 6, it will do 6 draws of 1/91 for the rare category, and select Items based on their probability in this category (calculated in the same way... 4/4+5+5 if there was 3 items with probability of 4, 5 and 5).

However if "maxItems": 6, "minItems": 4, how the number of draw get decided? is it based on the number of items for the category selected?

i.e. in Food, if apple get selected, which has "maxStack":2 and "minStack": 1, if 2 get picked, I have only 4 slot left, when number of slot >= minItems, no more draw?

I'll log another ticket for water bottle (so others can find your answer if they search later)...

Share this comment


Link to comment
1 hour ago, Bowabos said:

CustomLoot does not seem to take into account config. Trying to get started, so picked up oil_barrel as an example...

Edit oxide\config\CustomLoot.json:

    "oil_barrel": {
      "enabled": true,
      "lootTable": "oil_barrel",
      "maxItems": 6,
      "minItems": 6,
      "gunsWithAmmo": false,
      "noGuns": false,
      "MaxBps": 3,
      "MinWeaponCondition": 50,
      "MaxWeaponCondition": 50,
      "ClearContainerFirst": true
    },

Tried also "ClearContainerFirst": false (I would expect that I would have normal loot + what is in CustomLoot in this case)...

Moreover edit oxide\data\CustomLoot\oil_barrel.json (which was auto created)

  "AlwaysSpawnList": [
    "jackhammer"
  ],

+ Removed from BlackList

To check if I'll get a jackhammer...

 

in server console: oxide.reload CustomLoot

Unloaded plugin CustomLoot v1.0.4 by Steenamaroo

Loaded plugin CustomLoot v1.0.4 by Steenamaroo

Calling 'OnServerInitialized' on 'CustomLoot v1.0.4' took 348ms

[CustomLoot] Finished populating all containers.

In game, break an oil_barrel (red one with usually crude+oil)... I get the default spawn (crude+oil).

Tried spawning a new oil_barrel too.

 

I'm probably doing something stupid somewhere...

Thanks in advance for your help...

Removed reply in wrong thread

Edited by pookins
as above

Share this comment


Link to comment

Max/Min items is a random number from the range you specify - It dictates how many items should be in a container.

Max/min stack is a random number from the range you specify and dictates how much of an item you should get - No point getting 1 wood, for example.

 

Neither of these affects probability.

  • Thanks 1

Share this comment


Link to comment