BetterLoot

A complete re-implementation of the drop system

Total Downloads: 42,529 - First Release: Feb 26, 2015 - Last Update: Mar 20, 2018

4.95699/5, 93 likes
  1. can anyone tell me how to use BetterLoot to change the loot scientists have???
     
  2. Simple answer :p
    Not supported

    LootConfig could maybe...
     
  3. I find it disappointing that you won't explain to people how to do this, "cannot be extended with ease". Actually it can be extended with ease, the only uneasy thing about this process is that it's lengthy and repetitive.

    First thing you need to know, what crates match the crates in-game (most of which are self explanatory):

    "bradley_crate" - Loot from Bradley APC
    "crate_basic" - Loot from Primitive Boxes (The small wooden boxes found by gas/pumping stations)
    "crate_elite" - Loot from Elite Crates
    "crate_mine"- Loot from Mining Carts
    "crate_normal"- Loot from Military Crates
    "crate_normal_2"- Loot from the Standard Crates you will normally find on the road and inside many monuments
    "crate_normal_2_food"- Loot from the bigger Food Crates (Identified by the picture of a knife and fork on the side)
    "crate_normal_2_medical"- Loot from the Medical Crates (Identified by medical cross on the side)
    "crate_tools"- Loot from Toolboxes
    "foodbox"- Loot from the much smaller Food Crates
    "heli_crate"- Loot from Helicopter Crates
    ----------------
    "loot_barrel_1" (Haven't as of yet played around with the barrels to give them an identity)
    "loot_barrel_2"
    ----------------

    For me this was half of the battle.
    Now there are two major things that you need to do;-
    - Number one you must add lines of code according to the crate you're trying to create a seperate loot table for within the BetterLoot.cs config.
    Here are some examples of that (I will be showing you the Elite Crate as an example side by side with the Standard Crate);-
    -----------------------------------------------------------------------------------------------------------------------------
    Regex eliteEx; //elite crate add
    Regex crateEx;
    -----------------------------------------------------------------------------------------------------------------------------
    int totalItemsC;
    int totalItemsE; //elite crate add
    -----------------------------------------------------------------------------------------------------------------------------
    List<ItemDefinition> originalItemsC;
    List<ItemDefinition> originalItemsE; //elite crate add
    -----------------------------------------------------------------------------------------------------------------------------
    string barrelTypes;
    string crateTypes;
    string eliteTypes; //Elite crate add
    -----------------------------------------------------------------------------------------------------------------------------
    bool enableCrates;
    bool randomAmountCrates;
    int minItemsPerCrate;
    int maxItemsPerCrate;
    bool enableElite; //elite crate add
    bool randomAmountElite; //elite crate add
    int minItemsPerElite; //elite crate add
    int maxItemsPerElite; //elite crate add
    -----------------------------------------------------------------------------------------------------------------------------
    bool refreshCrates;
    bool refreshElite; //elite crate add
    -----------------------------------------------------------------------------------------------------------------------------
    minItemsPerCrate = Convert.ToInt32(GetConfig("Crate", "minItemsPerCrate", 3));
    maxItemsPerCrate = Convert.ToInt32(GetConfig("Crate", "maxItemsPerCrate", 6));
    refreshCrates = Convert.ToBoolean(GetConfig("Crate", "refreshCrates", true));
    crateTypes = Convert.ToString(GetConfig("Crate", "crateTypes", "crate_normal|crate_tools"));
    enableCrates = Convert.ToBoolean(GetConfig("Crate", "enableCrates", true));
    randomAmountCrates = Convert.ToBoolean(GetConfig("Crate", "randomAmountCrates", true));

    //Start Elite json add
    minItemsPerElite = Convert.ToInt32(GetConfig("Elite", "minItemsPerElite", 3));
    maxItemsPerElite = Convert.ToInt32(GetConfig("Elite", "maxItemsPerElite", 6));
    refreshElite = Convert.ToBoolean(GetConfig("Elite", "refreshElite", true));
    eliteTypes = Convert.ToString(GetConfig("Elite", "eliteTypes", "crate_elite"));
    enableElite = Convert.ToBoolean(GetConfig("Elite", "enableElite", true));
    randomAmountElite = Convert.ToBoolean(GetConfig("Elite", "randomAmountElite", true));
    //End Elite json add
    -----------------------------------------------------------------------------------------------------------------------------
    originalItemsC = new List<ItemDefinition>();
    originalItemsE = new List<ItemDefinition>(); //Elite Crate Add
    -----------------------------------------------------------------------------------------------------------------------------
    else if (crateEx.IsMatch(container.gameObject.name.ToLower()) && enableCrates)
    {
    SuppressRefresh(container);
    ClearContainer(container);
    min = minItemsPerCrate;
    max = maxItemsPerCrate;
    if (seperateLootTables)
    type = "crate";
    else
    type = "default";
    refresh = refreshCrates;
    }

    else if (eliteEx.IsMatch(container.gameObject.name.ToLower()) && enableElite) //Elite Crate Add
    {
    SuppressRefresh(container);
    ClearContainer(container);
    min = minItemsPerElite;
    max = maxItemsPerElite;
    if (seperateLootTables)
    type = "elite";
    else
    type = "default";
    refresh = refreshCrates;
    } //Elite Crate Add Stop
    -----------------------------------------------------------------------------------------------------------------------------
    Hopefully these examples give you the right idea, there are more lines of code that you need to add but this should help you get your bearings, it's much simpler than it seems as the code is right there infront of you, all you need to do is copy it (I would advise rewriting and not copying and pasting) and change names accordingly, also triple check your codes once you have written them.

    eliteTypes = Convert.ToString(GetConfig("Elite", "eliteTypes", "crate_elite"));

    "crate_elite" this is what will link to the crates you see ingame. "Elite" and "elite" are versatile as you're the one creating them. If you so wished you could call them "Chicken" and "chicken" but don't do that, keep it relevant for the crate you're adding "Tools" "tools" "Meds" "meds" ect ect...

    The lines appear by the letter 'originalItemsE' are also versatile to your preference but again keep them relative and make sure you don't have 2 of the same letter.

    int totalItemsB;
    int totalItemsC;
    int totalItemsE; //elite crate add
    int totalItemsM; //Military Crate add
    int totalItemsR; //Bradley crate add
    int totalItemsT; //Tool crate add
    int totalItemsP; //Primative crate add

    Here you can see for Bradley I use the letter R, as B is already used by Barrels.

    Now all that's left for you to do is add the itemlists into the LootTable.JSON (Supply Drops and Heli Crates have a seperate .JSON as you more than likely already know. You don't need to do any of this for Supply Drops or Heli)

    Here is a ridiculously bad loot table just to show you what it should end up looking like with a few crates added:-

    {
    "ItemListBarrels": {
    "antiradpills": 5,
    "apple": 4,
    "blueberries": 1,
    },
    "ItemListCrates": {
    "ammo.rocket.basic": 1,
    "ammo.rocket.hv": 1,
    "ammo.rocket.fire": 1,
    },
    "ItemListElite": {
    "autoturret": 1,
    "explosives": 1,
    "explosive.timed": 1,
    "rocket.launcher": 1,
    "hazmatsuit_scientist": 1,
    },
    "ItemListMil": {
    "rifle.ak": 1,
    "smg.thompson": 1,
    "barricade.stone": 1,
    "pistol.semiauto": 1,
    "pistol.python": 1,
    },
    "ItemListBrad": {
    "explosive.timed": 2,
    "rifle.ak": 3,
    "rocket.launcher": 2,
    "smg.mp5": 3,
    "shotgun.spas12": 4,
    "lmg.m249": 10,
    "pistol.m92": 4,
    "rifle.lr300": 2,
    },
    "ItemListTool": {
    "chainsaw": 10,
    },
    "ItemListPrim": {
    "arrow.bone": 10,
    }
    }

    I apologize if I haven't explained this very well, just trying to summarize for everyone without droning on.
    If anyone needs help with this contact me through steam, I'll be willing to further explain.
    [DOUBLEPOST=1521918557][/DOUBLEPOST]
    Check my previous post :)
     
  4. So me and LegBend are having fun with this one, I have edited your code to add Bradley, Primitive, Military, Elite and Tool crates as separate entities with separate listings in the loot table. All works fine until I attempt to add Medical or Food variations of the crate in the same way. I want to have control of what is in these crates and not add them to the generic crate config. Yet no matter the config for these crates they revert to the generic crate loot. Any idea why this wouldn't work?
     
  5. Is there like a default better loot thing already there or do you have to do everything by yourself, because honestly, I have no clue what to do.
     
  6. It appears the /blacklist additem <item> command doesn't work at all. I tried adding several items to the blacklist with the command, to no avail. I also edited `blacklist.json` and reloaded the plugin, but that also had no effect.
     
  7. "enforceBlacklist": false, ?
     
  8. So even when I completely remove all traces of food crates and medical crates from the config it still acts as if they're "normal_crate_2" in affect...
    Completely bafffled.
     
  9. Are there any plans to add blueprints to the loot tables or name listing?

    I've searched and searched to find a way to work with blueprints in loot tables and found none. The only references to blueprints are in game; crafting, researching, finding, admin giving to players....

    I want to add/remove/change the blueprint drop rates, how do I accomplish this?
     
  10. I found this from Shady 757 in a forum discussion.

    Code:
    var bpItem = ItemManager.CreateByName("blueprintbase", 1);
    bpItem.blueprintTarget = targetItemID;
    Perhaps in the PopulateContainer() function a small rand could be added to set an item as a blueprint....

    Right before items.Add() a quick rand if say one percent? Then do the convert to blueprint. Then items.Add().

    Or even something like this psuedo code...
    Code:
    item mabieBlueprint(item)
         var targetItemID = item;
         var rand = rand(0, 99);
         if (rand == 0) {
              var bpItem = ItemManager.CreateByName("blueprintbase", 1);
    bpItem.blueprintTarget = targetItemID;
         } else {
         return;
         }
    return targetItemID; //Dunno if this is needed.
    }
    Just a real quick and dirty to add the chance for an item to be a blueprint rather then the item. It would need some dev and test.
     
  11. I feel like this plugin is broken I tried it all (or maybe im dumb) I tried everything! How do I make loot tables SEPARATE ONES for Elite and Military?
    Also can you add scientist loot tables? Also Zombies/Murderers.
     
  12. JMJ

    JMJ

    Can anyone help me with this? I simply want to control what spawns in the green boxes in rad towns.. But, this is way out of my league lol. I open the CS and it's like im in the matrix. I can handle all the config and data file editing but im lost with getting that crate added to the main code. Any help here would be amazing! -Have received the help I needed!
     
    Last edited by a moderator: Apr 1, 2018
  13. Hi, i have just set up a server on my pc for myself and a couple of close friends, and added the "Better Loot" mod into the server, but sadly enough im not that good at config files.

    so i am wondering if anyone has already done/updated their config file for better loot would you kindly ping it to me so i can use it for my own server, of course i may change a few things.

    thank you in advance.
     
  14. Can anyone tell me if there is a way to edit the items list for each individual crate/barrel instead of all the barrel types and crate types spawning the same items because there is not multiple items lists, for example i am wanting to edit the the medical crate separate to the food crate and every crate separate to each other to only spawn in certain items.

    If anyone can help that would be grate
    Thanks
     
  15. Can someone send me their LootTable.json file for the better loot plugin for rust, because i am not very good at all this stuff.

    Of course i will change the majority off the things, its for a server that is for me and like 3 friends
     
  16. Why do I get the feeling that FuJiCuRa is no longer going to support, update, or modify his free oxide plugins.... Check his site, he's gone pay for play.
     
  17. My friend, before you start complaining about a developer's muse to update a plugin or not, check next time better before the date of the latest plugin update!
     
  18. Wow, that was harsh; just expressing my OPINION.
    Conflict of interest - Wikipedia
     
  19. Hey Guys,

    My English is not so good but maybe you can understand me i dowloaded the BetterLoot Plugin vor Oxide and i Want only better Loot in all Chest so like at Dome maybe 3 Rockets or somethink like this i see you must change the config but i dont now how its works like i have 50x server so maybe somebody had a Config for me?