We've moved! Join us as we continue development on our new site at umod.org!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BetterLoot

A complete re-implementation of the drop system

Total Downloads: 40,846 - First Release: Feb 26, 2015 - Last Update: Mar 20, 2018

4.95699/5, 93 likes
  1. I did change the BetterLoot.cs to include the Elite crate loot table and will be moving onto the Military crate after I got this working. The LootTable.json seems to be correct, i've also checked the code please see below.

    Code:
    {
        "ItemListBarrels": {
            "antiradpills": 5,
            "apple": 10,
            "black.raspberries": 10,
            "bleach": 5,
            "blueberries": 10,
            "can.beans": 10,
            "can.tuna": 10,
            "candycane": 10,
            "chocholate": 10,
            "ducttape": 5,
            "fuse": 5,
            "gears": 5,
            "glue": 5,
            "granolabar": 10,
            "clone.hemp": 10,
            "largemedkit": 5,
            "metalblade": 5,
            "metalpipe": 5,
            "fish.minnows": 10,
            "mushroom": 10,
            "jar.pickle": 10,
            "propanetank": 5,
            "pumpkin": 10,
            "clone.pumpkin": 10,
            "riflebody": 5,
            "roadsigns": 5,
            "rope": 5,
            "semibody": 5,
            "sewingkit": 5,
            "sheetmetal": 5,
            "fish.troutsmall": 10,
            "smallwaterbottle": 10,
            "smgbody": 5,
            "metalspring": 5,
            "sticks": 5,
            "syringe.medical": 5,
            "tarp": 5,
            "techparts": 5
        },
        "ItemListCrates": {
            "antiradpills": 5,
            "apple": 10,
            "black.raspberries": 10,
            "bleach": 5,
            "blueberries": 10,
            "can.beans": 10,
            "can.tuna": 10,
            "candycane": 10,
            "chocholate": 10,
            "ducttape": 5,
            "fuse": 5,
            "gears": 5,
            "glue": 5,
            "granolabar": 10,
            "clone.hemp": 10,
            "largemedkit": 5,
            "metalblade": 5,
            "metalpipe": 5,
            "fish.minnows": 10,
            "mushroom": 10,
            "jar.pickle": 10,
            "propanetank": 5,
            "pumpkin": 10,
            "clone.pumpkin": 10,
            "riflebody": 5,
            "roadsigns": 5,
            "rope": 5,
            "semibody": 5,
            "sewingkit": 5,
            "sheetmetal": 5,
            "fish.troutsmall": 10,
            "smallwaterbottle": 10,
            "smgbody": 5,
            "metalspring": 5,
            "sticks": 5,
            "syringe.medical": 5,
            "tarp": 5,
            "techparts": 5
        },
        "ItemListElite": {
            "antiradpills ": 5,
            "apple": 10,
            "black.raspberries": 10,
            "bleach": 5,
            "blueberries": 10,
            "can.beans": 10,
            "can.tuna": 10,
            "candycane": 10,
            "chocholate": 10,
            "ducttape": 5,
            "fuse": 5,
            "gears": 5,
            "glue": 5,
            "granolabar": 10,
            "clone.hemp": 10,
            "largemedkit": 5,
            "metalblade": 5,
            "metalpipe": 5,
            "fish.minnows": 10,
            "mushroom": 10,
            "jar.pickle": 10,
            "propanetank": 5,
            "pumpkin": 10,
            "clone.pumpkin": 10,
            "riflebody": 5,
            "roadsigns": 5,
            "rope": 5,
            "semibody": 5,
            "sewingkit": 5,
            "sheetmetal": 5,
            "fish.troutsmall": 10,
            "smallwaterbottle": 10,
            "smgbody": 5,
            "metalspring": 5,
            "sticks": 5,
            "syringe.medical": 5,
            "tarp": 5,
            "techparts": 5
        }
    }
    Code:
    case "elite":
                        do
                        {
                            selectFrom = null;
                            item = null;
                            var r = rng.Next(totalItemWeightE);
                            for (var i = 0; i < 5; ++i)
                            {
                                limit += itemWeightsE[i];
                                if (r < limit)
                                {
                                    selectFrom = itemsE[i];
                                    break;
                                }
                            }
                            if (selectFrom == null)
                            {
                                if (--maxRetry <= 0)
                                {
                                    PrintError("Endless loop detected: ABORTING");
                                    break;
                                }
                                continue;
                            }
                            itemName = selectFrom[rng.Next(0, selectFrom.Count)];
                            item = ItemManager.CreateByName(itemName, 1);
                            if (item == null)
                            {
                                continue;
                            }
                            if (item.info == null)
                            {
                                continue;
                            }
                            break;
                        } while (true);
                        if (item == null)
                            return null;
                        if (item.info.stackable > 1 && separateLootTable.ItemListElite.TryGetValue(item.info.shortname, out limit))
                        {
                            if (limit > 0)
                            {
                                if (randomAmountElite)
                                    item.amount = rng.Next(1, Math.Min(limit, item.info.stackable));
                                else
                                    item.amount = Math.Min(limit, item.info.stackable);
                            }
                        }
                        return item;
     
    DeliciousAce likes this.
  2. I updated my LootTable.json from the NameList.json file and nothing is happening, I remove things from the lootTabke and that worked just don't see the items I added to the barrels and crates.
    Thanks!
     
  3. looking for some help if possible trying to edit scrap and Bradley but they don't appear to be in the file list so if i add this to my loottable.json will it work?
    "ScrapAmounts": {
    "bradley_crate": 0,
    "crate_basic": 3,
    "crate_elite": 25,
    "crate_mine": 0,
    "crate_normal": 8,
    "crate_normal_2": 5,
    "crate_normal_2_food": 0,
    "crate_normal_2_medical": 0,
    "crate_tools": 5,
    "foodbox": 0,
    "giftbox_loot": 0,
    "heli_crate": 0,
    "loot_barrel_1": 2,
    "loot_barrel_2": 2,
    "loot_component_test": 0,
    "loot_trash": 0
    },
    "BradleyCrate": {
    "includeBradleyCrate": true,
    "maxItemsPerBradleyCrate": 4,
    "minItemsPerBradleyCrate": 2,
    "randomAmountBradleyCrate": true,
    "useCustomTableBradley": true
    },
     
  4. Can anyone help me? barrels and crates only gives shit items... i dont understand this
     
  5. adjust what you want to spawn in barrels in the loot.json file delete what items you don't want mine looks like this
    "ItemListBarrels": {
    "propanetank":5,
    "gears": 5,
    "rope": 3,
    "tarp": 3,
    "metalblade": 5,
    "metalpipe": 5,
    "metalspring": 5,
    "sheetmetal": 5,
    "semibody": 5,
    "sewingkit": 5,
    "roadsigns": 5,
    "lowgradefuel":10
     
  6. how do i add so ppl can find weapon in crates or what
     
  7. add or remove what you want to see in crates from "ItemListCrates"
     
  8. Can someone please share the json file for this?
    Finding it difficult to configure the items that are already available in vanilla and simply multiplying their tables x3 for example across the board..

    Thank you.



     
    Last edited by a moderator: Jul 31, 2018
  9. Hey just try to Change the loot of the Bradley in his own Loot Config File Called BradleyCrate.json
    If you want to have more scrap in Barrels and Boxes, edit the file BetterLoot.json on this part:
    Example: "crate_tools": 10, the number is the amount of Scrap that will be Spawn

    Code:
      "ScrapAmounts": {
        "bradley_crate": 0,
        "codelockedhackablecrate": 0,
        "crate_basic": 20,
        "crate_elite": 25,
        "crate_mine": 0,
        "crate_normal": 10,
        "crate_normal_2": 10,
        "crate_normal_2_food": 0,
        "crate_normal_2_medical": 0,
        "crate_tools": 10,
        "crate_underwater_advanced": 10,
        "crate_underwater_basic": 10,
        "foodbox": 0,
        "giftbox_loot": 0,
        "heli_crate": 0,
        "loot_barrel_1": 10,
        "loot_barrel_2": 10,
        "loot_component_test": 0,
        "loot_trash": 10,
        "loot-barrel-1": 10,
        "loot-barrel-2": 10,
        "minecart": 0,
        "oil_barrel": 0,
        "stocking_large_deployed": 0,
        "stocking_small_deployed": 0,
        "supply_drop": 0,
        "trash-pile-1": 10
      },
     
  10. Any one have a edited BetterLoot.cs file with Minecarts and Elite Crates in?
    I try since few Hours to get my Modified BetterLoot.cs to work, but it seems its missing something in.
    I get this Error in Server Console:
    Code:
    Error while compiling: BetterLoot.cs(1085,26): error CS0150: A constant value is expected
    
    Part of BetterLoot.json

    Code:
       "Minecart": {
        "includeMinecart": true,
        "maxItemsPerMinecart": 9,
        "minItemsPerMinecart": 4,
        "randomAmountMinecart": false,
        "useCustomTableMinecart": true
      },
      "Rarity": {
        "Override": {
          "autoturret": 4,
          "lmg.m249": 4,
          "targeting.computer": 3
        }
      },
    And in the data\BetterLoot Folder i wrote a new Minecart.json File

    Code:
    {
      "ItemList": {
        "lowgradefuel": 200,
        "gunpowder": 200,
        "jackhammer": 1,
        "metal.refined": 100,
        "metal.fragments": 200,
        "charcoal": 1000,
        "hat.miner": 1,
        "hat.candle": 1,
        "flashlight.held": 1
      }
    }

    I rly need some help with this, i appreciate any help I get!!
    Coding was never really my strength, but I try to teach myself a bit of by learning-by-doing :)
    I hope I do not bore or bother anyone with it, but i need your help guys.

    Please Use the Search Function in Notepad++ and search for "Minecart" so u can find my edited parts and rows!
     
    Last edited by a moderator: Aug 13, 2018
  11. Just did everything as said. but got Error after. Just want to add separate loot for crate_normal.
    Code:
     Failed to run a 0.10 timer in 'BetterLoot v2.15.0' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.BetterLoot.PopulateContainer (LootContainer container) [0x00133] in <c411c8a42e674a8aaf76befed735d00e>:0
      at Oxide.Plugins.BetterLoot.<UpdateInternals>m__1 () [0x0007f] in <c411c8a42e674a8aaf76befed735d00e>:0
      at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in <fc2b4388d9974d719a0972b08cea0f17>:0
     
    Last edited by a moderator: Aug 13, 2018
  12. I want a barrel to drop a certain amount of scrap
    and other things like crates to do the same but i cant find how
    Help?
     
  13. Hello guys. i have the problem that i get the same loot in all crates. I want the game (better loot) to seperate from food crates, Medical crates, Military crates etc. So at the moment the military crate spawns low tier items like normal crates. Is it possible to add certain rows to the betterloot.json and the lootTable.json, so that i can choose what item spawns in which crate ?

    maybe like this LootTable.json

    "ItemListCrates": {
    ........

    "ItemListMilitaryCrates": {
    ......

    "ItemListMedicalCrates": {
    .........

    Betterloot.json

    "Crate": {
    "crateTypes": "crate_normal_2_food",
    "enableCrates": true,
    "maxItemsPerCrate": 8,
    "minItemsPerCrate": 2,
    "randomAmountCrates": true,
    "refreshCrates": true

    "Crate": {
    "crateTypes": "crate_normal_2",
    "enableCrates": true,
    "maxItemsPerCrate": 10,
    "minItemsPerCrate": 5,
    "randomAmountCrates": true,
    "refreshCrates": true

    .................. and so on.



    I would be very thankful for help.
     
  14. hello, u can not separate the loot table for each crate with this plugin, just for barrels and all crates u can do diffrent loot table.

    1.so u can now edit the plugin and add self each crate what u want here is a little guide BetterLoot
    2.or u search by goggle for AlphaLoot, there u can edit the loottable for each crate u want.
     
  15. Hi, thanks for the quik response.
    is it maybe possible to spawn more items in the military crate then in the other crates ?

    something like this: Betterloot.json config


    Crate": {
    "crateTypes": "crate_normal", // Military crate
    "enableCrates": true,
    "maxItemsPerCrate": 15,
    "minItemsPerCrate": 10,
    "randomAmountCrates": true,
    "refreshCrates": true
    }
    "Crate": {
    "crateTypes": "crate_normal_2", //basic crate
    "enableCrates": true,
    "maxItemsPerCrate": 5,
    "minItemsPerCrate": 3,
    "randomAmountCrates": true,
    "refreshCrates": true
    }
     
  16. without modify the plugin, no.
     
  17. How do I get the normal crates and the green military crates having a different drop table?
     
  18. >> BetterLoot <<
     
  19. I tried to follow it and add it in but i fucked up somewhere :c

    Is there somewhere that can validate the code? Like how you can validate your .json files to make sure its all correct?
     
  20. I tried to follow this and it made no sense to me would it be possible for you to upload files??