Jump to content

Max number of slots in a container

Closed 1.0.1 1.0.2

ALiEN JiM
ALiEN JiM

Posted

Hi, So i have changed the max number of slots in a container to 6 but only one slot is filled, is there a way to make it fill all 6 slots with different items from the loot table?

mattffhh

Posted

Hey again @ALiEN JiM 🙂

I’m working on adding that "always fill all slots" config option for you. Once it's on, every slot will be filled with items from the loot table. If you decide to keep it off, the number of items will still be randomized based on their weights. I'm hoping to have this wrapped up later today, and I'll let you know as soon as it's done!

 

mattffhh

Posted

Changed Status from Pending to Work in Progress

Changed Fixed In to Next Version

ALiEN JiM

Posted

as always thank you for your replies and all the work you do

mattffhh

Posted (edited)

Hey,

I believe the config is now working. However I'm gonna run some more tests on carbon, before publishing the update 🙂 
I have been testing on Oxide so far, and this is the results.


I've added two more config options:

  "Always fill all cointainer slots": true,
  "Prevent duplicate items": true,


In this image I have both options set to true.

image.png.32d21a630b9ade58bb46a45d4502a6e3.png

Based on the logic, all unique items will be added, and a fallback system ensures every lucky crate is filled to the max when "Always fill all container slots" is set to true. To fix the issue shown in the image, make sure the loot table is large enough or set "Prevent duplicate items" to false.

With a config like this:

  "Always fill all cointainer slots": true,
  "Prevent duplicate items": false,

image_2024-10-12_201901378.png.ba9c5ba2a47232e554c14189866b4b5b.png
The loot will look something like this.

 

With both values set to false, the Lucky Crate will look something like this.
 

  "Always fill all cointainer slots": false,
  "Prevent duplicate items": false,



image.png.10acca3ee7e9330cbc679d4c67008d63.png

Finally with only  "Prevent duplicate items": false" it will make sure to only add one of each item.

  "Always fill all cointainer slots": false,
  "Prevent duplicate items": true,

 image.png.79dfa28757cf1c32def1700d55c7ef5d.png

Keep in mind as long as the option

"Always fill all cointainer slots": false,

Every item that appear will be based off the weight, and making it a chance.

The loot table used in the testing:
 

{
  "LootTable": [
    {
      "ItemName": "rifle.ak",
      "Weight": 1,
      "Amount": 1
    },
    {
      "ItemName": "weapon.mod.holosight",
      "Weight": 5,
      "Amount": 1
    },
    {
      "ItemName": "ammo.pistol",
      "Weight": 50,
      "Amount": 10
    },
    {
      "ItemName": "scrap",
      "Weight": 75,
      "Amount": 100
    },
    {
      "ItemName": "metal.fragments",
      "Weight": 50,
      "Amount": 250
    },
    {
      "ItemName": "supply.signal",
      "Weight": 3,
      "Amount": 1
    },
    {
      "ItemName": "wood",
      "Weight": 100,
      "Amount": 500
    },
    {
      "ItemName": "high.quality.metal",
      "Weight": 15,
      "Amount": 50
    },
    {
      "ItemName": "rifle.bolt",
      "Weight": 2,
      "Amount": 1
    },
    {
      "ItemName": "explosive.timed",
      "Weight": 1,
      "Amount": 1
    },
    {
      "ItemName": "weapon.mod.silencer",
      "Weight": 10,
      "Amount": 1
    },
    {
      "ItemName": "leather",
      "Weight": 50,
      "Amount": 100
    },
    {
      "ItemName": "sulfur.ore",
      "Weight": 75,
      "Amount": 300
    },
	{
	  "ItemName": "grenade.f1",
	  "Weight": 8,
	  "Amount": 5
	},
	{
	  "ItemName": "smg.2",
	  "Weight": 4,
	  "Amount": 1
	},
	{
	  "ItemName": "metal.ore",
	  "Weight": 60,
	  "Amount": 200
	},
	{
	  "ItemName": "rifle.lr300",
	  "Weight": 2,
	  "Amount": 1
	},
	{
	  "ItemName": "pistol.m92",
	  "Weight": 6,
	  "Amount": 1
	},
	{
	  "ItemName": "cloth",
	  "Weight": 100,
	  "Amount": 500
	},
	{
	  "ItemName": "stone",
	  "Weight": 90,
	  "Amount": 1000
	},
	{
	  "ItemName": "rifle.l96",
	  "Weight": 1,
	  "Amount": 1
	},
	{
	  "ItemName": "metal.pipe",
	  "Weight": 25,
	  "Amount": 4
	},
	{
	  "ItemName": "syringe.medical",
	  "Weight": 30,
	  "Amount": 2
	}
  ]
}



Hope this is understandable, and I'll give you an final update when the update is live 🙂

Kind regards,
mattffhh

image.png

Edited by mattffhh
mattffhh

Posted

Hey!

After some testing on Carbon I discovered some flaws with the current implementation of the duplication checks. This setting will not be implemented in the upcoming update.
However the always fill all container slots system is fully working on both Oxide and Carbon.

I have additionally added a test command to make it easier to configure Lucky Crate. The command is /lc and requires permission: 'luckycrates.admin'.
Lastly I've added a Lucky Crate text to the map markers. Previously said "shop"

image.png.793ce38a6af77e9b903860da5c6d5361.png

I will be pushing the update in the next minutes. Check the update patch info for more information 🙂 

Kind regards,
mattffhh
 

  • Like 1
mattffhh

Posted

Changed Status from Work in Progress to Closed

ALiEN JiM

Posted

apart from duplications it is working great oh there was one odd thing no big deal tho but more funny than anything i let the picture speak for itself lol

image.png.65b05bf17199f6224a6945b84871c3a8.png

  • Haha 1
mattffhh

Posted

Haha, yeah, with the current terrain check, this kind of thing happens sometimes. Just a heads-up—I’ve seen the Lucky Crate spawn under some of the new hills too. I’ll be improving the logic to avoid these weird terrain issues in the future.

Duplication is kind of working, but I’m holding off on releasing it until I fix a few bugs. For now, you’ll have to use some ladders to reach that one, lol. And thanks for the positive feedback! If there's anything else, feel free to let me know.

Kind regards,
mattffhh

  • Like 1
ALiEN JiM

Posted

5 hours ago, mattffhh said:

Haha, yeah, with the current terrain check, this kind of thing happens sometimes. Just a heads-up—I’ve seen the Lucky Crate spawn under some of the new hills too. I’ll be improving the logic to avoid these weird terrain issues in the future.

Duplication is kind of working, but I’m holding off on releasing it until I fix a few bugs. For now, you’ll have to use some ladders to reach that one, lol. And thanks for the positive feedback! If there's anything else, feel free to let me know.

Kind regards,
mattffhh

Would It be possible to add a Min and Max Amount of each item?

Something like:

    {
      "ItemName": "scrap",
      "Weight": 3,
      "AmountMin": 50
      "AmountMax": 150
    },

 

as always many thanks for your speedy replies and updates

mattffhh

Posted

7 hours ago, ALiEN JiM said:

Would It be possible to add a Min and Max Amount of each item?

Something like:

    {
      "ItemName": "scrap",
      "Weight": 3,
      "AmountMin": 50
      "AmountMax": 150
    },

 

as always many thanks for your speedy replies and updates

Hey, thanks for the suggestion. This is something that I'm working on, and should be in the next update!

  • Love 1
1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

103.5k

Files Sold

Total number of files sold.

2.1m

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.