Jump to content

Lootable Bug

Closed 1.3.7 1.3.8

Yuki

Hi again,

when changing the name of the loottable to another name, on apc death the following errror occurs

Exception while calling NextTick callback (KeyNotFoundException: The given key was not present in the dictionary.)
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <fb001e01371b4adca20013e0ac763896>:0
at Oxide.Plugins.CustomBradley+CustomBradleyComponent+<LockInRadius>c__AnonStorey1`1[T].<>m__0 () [0x00264] in <a73f2387151d497283d40d6b12651131>:0
at Oxide.Core.OxideMod.OnFrame (System.Single delta) [0x00051] in <bae5f1223fce49c493b01571c99dce02>:0

Changing the amount of items or the chances in the default loottables result in resseting the values to the predefined values.

 

AlphaLoot is unloaded btw.

Share this comment


Link to comment

were there any errors on load? looks like JsonError in loottable and it doesn't get loaded resulting in this error on bradley death and causes loot to  reset to default

Share this comment


Link to comment

hi no error message on reload / loading tthe plugin. Json validator resulted in no error, too.

just for a quick test i changed the first item in your loottable to 1 for max min 5.56 ammo. 

On saving and reloading the plugin no error message popped up, checking the config after the reload showed that the config resetted

11/24 22:00:25 | [Lone.Design Update Checker] CustomBradley.cs was just loaded in, checking for updates...
11/24 22:00:25 | Loaded plugin CustomBradley v1.3.7 by shaitobu
11/24 22:00:25 | [Lone.Design Update Checker] is up to date.

 

Share this comment


Link to comment

Loottable is correct

[
   {
      "LootTable":[
         {
            "Item Shortname":"ammo.rifle",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":1,
            "Max. Amount":1
         },
         {
            "Item Shortname":"ammo.rifle.incendiary",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":60,
            "Max. Amount":200
         },
         {
            "Item Shortname":"ammo.rifle.explosive",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":60,
            "Max. Amount":100
         },
         {
            "Item Shortname":"ammo.rifle.hv",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":80,
            "Max. Amount":150
         },
         {
            "Item Shortname":"techparts",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":15,
            "Max. Amount":25
         },
         {
            "Item Shortname":"explosive.timed",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":2,
            "Max. Amount":4
         },
         {
            "Item Shortname":"ammo.rocket.fire",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":5,
            "Max. Amount":8
         },
         {
            "Item Shortname":"ammo.rocket.hv",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":3,
            "Max. Amount":5
         },
         {
            "Item Shortname":"rifle.l96",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"weapon.mod.8x.scope",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":1,
            "Max. Amount":1
         },
         {
            "Item Shortname":"lmg.m249",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"smg.thompson",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":1,
            "Max. Amount":1
         },
         {
            "Item Shortname":"smg.mp5",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"rifle.ak",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"rifle.bolt",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":1,
            "Max. Amount":1
         },
         {
            "Item Shortname":"rifle.lr300",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":1,
            "Max. Amount":1
         },
         {
            "Item Shortname":"hazmatsuit",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"hazmatsuit.spacesuit",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"hazmatsuit.arcticsuit",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"metal.refined",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":50,
            "Max. Amount":100
         },
         {
            "Item Shortname":"crude.oil",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":100,
            "Max. Amount":150
         },
         {
            "Item Shortname":"supply.signal",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":0,
            "Max. Amount":1
         },
         {
            "Item Shortname":"explosive.satchel",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":4,
            "Max. Amount":6
         },
         {
            "Item Shortname":"metalpipe",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":12,
            "Max. Amount":25
         },
         {
            "Item Shortname":"explosives",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":5,
            "Max. Amount":10
         },
         {
            "Item Shortname":"gunpowder",
            "Custom Displayname":"",
            "SkinID":0,
            "Item chance (0.01% - 100%)":100.0,
            "Min. Amount":500,
            "Max. Amount":1000
         }
      ]
   }
]

 

I have taken your loottable for an easier comparison, just exchanged the minimum and maximum amount for the "Item Shortname":"ammo.rifle",

Edited by Yuki
inserted the code in a better optical view

Share this comment


Link to comment

just to check my assumption i used the function private void LoadLootTables() in line 463 & 464 of the file CustomBradley.cs. I changed the variables AmountMin and AmountMax to the value 2. After saving, the config files were automatically adjusted to the value 2 during the reload. 
So at each reload the cs file will automatically rewrite the values written in the lootable to the default values.

Share this comment


Link to comment

just for testing ofc, my assumption that the cs file is overwritten the generated lootables...

Edited by Yuki

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.6k

Customers

Total customers served.

81.4k

Files Sold

Total number of files sold.

1.6m

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.