1. the weights of all categories in one array are added to total sum, which reflects the 100%
2. a random number between zero and that sum is taken
3. go through the list and check if random number is larger or equal than sum minus weight of the current category
4. take the category which matches and redo the first steps until there are no subSpawn entries
5. add all items & blueprints of the category to inventory (amount of each is the quantity that will be added to inventory)
Code:"LootSpawn.RadTown2": { "items": [], "blueprints": [], "subSpawn": [ // Sum = 133, CurSum = 0, RandNum = Random.Range(0, 133) = 25 { "category": "LootSpawn.GenericLessNothing", "weight": 50 // CurSum += 50; percent = CurSum/(Sum/100f) = 50 / (133/100f) = 37.59% }, // RandNum >= (Sum - CurSum) // 25 >= 83 ? no, check next { "category": "Blueprints.Common", "weight": 20 // CurSum += 20; percent = CurSum/(Sum/100f) = 70 / (133/100f) = 52.63% }, // RandNum >= (Sum - CurSum) // 25 >= 63 ? no, check next { "category": "Blueprints.Uncommon", "weight": 10 // CurSum += 10; percent = CurSum/(Sum/100f) = 80 / (133/100f) = 60.15% }, // RandNum >= (Sum - CurSum) // 25 >= 53 ? no, check next { "category": "Blueprints.Rare", "weight": 5 // CurSum += 5; percent = CurSum/(Sum/100f) = 85 / (133/100f) = 63.91% }, // RandNum >= (Sum - CurSum) // 25 >= 48 ? no, check next { "category": "Blueprints.VeryRare", "weight": 3 // CurSum += 3; percent = CurSum/(Sum/100f) = 88 / (133/100f) = 66.17% }, // RandNum >= (Sum - CurSum) // 25 >= 45 ? no, check next { "category": "Collection.Attire", "weight": 30 // CurSum += 30; percent = CurSum/(Sum/100f) = 118 / (133/100f) = 88.72% }, // RandNum >= (Sum - CurSum) // 25 >= 15 ? yes, take this { "category": "HQMetal", "weight": 15 // CurSum += 15; percent = CurSum/(Sum/100f) = 133 / (133/100f) = 100.00% } // skipped ] }

LootConfig
Allows you to adjust the server's loot list
Total Downloads: 14,928 - First Release: Mar 27, 2015 - Last Update: May 20, 2018
- 5/5, 21 likes
-
Ok Nogrod but can you explain to me how to increase the number of guns people can find in boxes, trash beans for exemple ? not that they find 4 guns in one box but could find one gun in one box in a rad, then another one a gun in another box at the airfield... To get multiple guns in multiple boxes on the map ?
Last edited by a moderator: Sep 21, 2015 -
And what means radtown1-2 ? Crates on radtown? Or rad barrels
-
-
@Matt10 Yeah I would like to know and understand how to increase the likelihood of items spawning affirm ( like guns, ammunitions, ... ) Just to be sure I use the plugin correctly. Thx
-
Nogrod updated LootConfig with a new update entry:
1.0.5
-
[DOUBLEPOST=1443237580,1443225297][/DOUBLEPOST] -
matt 10 yeah if you agree to give me your file I will compare it to mine and will try to understand the differences with weight and so on.
You can send it to me in private ? or here ( maybe it will help other people as well ? ) Thx. -
So first off, I'd recommend using JSON Editor Online - view, edit and format JSON online or another online editor to manage the file. To use the site, you paste the code on the left-hand side and hit the arrow pointing to the right, then make your edits on the right-hand side and update the code by pushing the arrow pointing left.
I'll paste my config file here: notable changes from default are that I've replaced the spawning of Explosives and of Timed Explosives Charges (C4) BP's with the non-BP versions (I want players to have to research those with BP fragments), reduced the overall spawn chance of Explosives/C4, modified the RadTown Crates to drop slightly rarer loot, given regular barrels a low% chance to spawn better barrel loot, and some other small adjustments that I decided would be best for the server.
The file is too large to post, so I attach it in its .json from to this post.Attached Files:
-
-
On first load and config file generation does this give vanilla loot or is it enhanced to begin with?
-
-
It will export the default rust loot when a new config is created. Without changes.
-
Thank you both. Good to know.
-
Nogrod updated LootConfig with a new update entry:
1.0.6
-
Nogrod updated LootConfig with a new update entry:
1.0.6
-
Immediately I apologize for the poor translation. It is very difficult to deal with the plug-in, who can throw off please tune in heavy loot to difficult recipes for C4 and so on mined.
-
so does anyone have a config similar to what betterloot was? I'm trying to achieve that again without using betterloot. I've tried to understand the config but its sort of confusing to me.
-
It is very difficult to set up - so useless.
Config file pervert... -
also rust server hosting is not meant to be easy...but with tools and knowledge of json you can handle the config
-
Get something like Notepad++ and use the Plugin manager to get some plugins like:
- JSON Viewer
- CS-Script
- GMOD LUA Lexer
- NppFTP
- JSLint
- JSTool