Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LegBend:
- 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.
Advertisement
Add Comment
Please, Sign In to add comment