Jump to content

Failed To Call Hook

Closed 2.1.6

After changing the difficulty_loot files, I reloaded the plugin and got this error. I triple checked the .json files and they showed no errors on them. 

 

Failed to call hook 'OnServerInitialized' on plugin 'RaidableBases v2.1.6' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.RaidableBases.<LoadTable>m__F (Oxide.Plugins.RaidableBases+TreasureItem ti) [0x00000] in <cfa995b892084dcea746f8afeffeff88>:0
at System.Collections.Generic.List`1[T].RemoveAll (System.Predicate`1[T] match) [0x0001a] in <eae584ce26bc40229c1b1aa476bfa589>:0
at Oxide.Plugins.RaidableBases.LoadTable (System.String file, System.Collections.Generic.List`1[T] lootList) [0x00037] in <cfa995b892084dcea746f8afeffeff88>:0
at Oxide.Plugins.RaidableBases.LoadTables () [0x000d1] in <cfa995b892084dcea746f8afeffeff88>:0
at Oxide.Plugins.RaidableBases.Initialize () [0x00024] in <cfa995b892084dcea746f8afeffeff88>:0
at Oxide.Plugins.RaidableBases.OnServerInitialized (System.Boolean isStartup) [0x00059] in <cfa995b892084dcea746f8afeffeff88>:0
at Oxide.Plugins.RaidableBases.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x004b7] in <cfa995b892084dcea746f8afeffeff88>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0

Share this comment


Link to comment

It looks like you may have got an error/typo in one of the loot files. First off try running them through a JSON validator such as https://jsonlint.com which should show you where the error is, rather than having to look through every line yourself. Just copy and paste the JSON data file content into it and click "Validate JSON". Failing that, delete the files you just edited and reload the plugin (back them up first so you can copy your edits over using correct formatting).

Edited by ZEODE

Share this comment


Link to comment

All my .json files have no errors. I can post them on here if someone else wants to look at them. I only removed things and didn't add anything.

Share this comment


Link to comment

RaidableBases Difficulty_Loot - Pastebin.com

 

I think I got it, this just seems harder to read and copy/paste with it

 

Edit, nope. That didn't work. Yeah, not sure how to work that site as I've never used it really. Might have once but don't remember lol

Try again...https://pastebin.com/raw/5wgPw6cs

Edited by T-Nuts

Share this comment


Link to comment

I downloaded and checked your zip files, all seem OK, but you have Normal.json in there which is blank, I think that is your problem, although not sure if it would cause that error.

 

Edited by ZEODE

Share this comment


Link to comment
22 minutes ago, T-Nuts said:

RaidableBases Difficulty_Loot - Pastebin.com

 

I think I got it, this just seems harder to read and copy/paste with it

 

Edit, nope. That didn't work. Yeah, not sure how to work that site as I've never used it really. Might have once but don't remember lol

Try again...https://pastebin.com/raw/5wgPw6cs

The file looks good in json validator apart from you have Easy.json on line 1, can I assume you don't actually have that in the json file which you are trying make the plugin load?

As I said above though, if you have a blank Normal.json file, I'm guessing that is your issue, although hopefully nivex will confirm.

Edited by ZEODE

Share this comment


Link to comment

Yes, I labeled all the file names in the pastebin thing since I couldn't drag and drop. It was just to separate them for ya'll since pastebin seems complicated right now. All .json files don't have errors and I'll delete the Normal.json but that's always been there from my knowledge

Share this comment


Link to comment

Also if something was wrong with the .json file, wouldn't it tell me when trying to load it that some file or files are corrupted and need fixing and not the whole plugin? It eventually says the plugin loaded and how many spots on the map have been picked for the bases but then none of the bases populate. Sorry for the separate messages here, kind of thinking on the go.

Share this comment


Link to comment
Just now, T-Nuts said:

Deleted the Normal.json file and still the same error so yeah, I'm at a loss here on what happened or what's wrong

What about the other loot profiles? Such as the Base_Loot and Weekday_Loot. Also did you edit the Profiles?

Run all of the json files through the validator unless you are sure you didn't edit any others. Other than that, the next step I guess would be to delete the entire data directory for RaidableBases and reload the plugin to start fresh. Back up the existing just in case, then you can refer to it to speed up making the changes again later. Or wait until nivex is around and ask him if he has any better ideas.

Share this comment


Link to comment
1 minute ago, T-Nuts said:

Also if something was wrong with the .json file, wouldn't it tell me when trying to load it that some file or files are corrupted and need fixing and not the whole plugin? It eventually says the plugin loaded and how many spots on the map have been picked for the bases but then none of the bases populate. Sorry for the separate messages here, kind of thinking on the go.

Yeah, it kinda is right here in your error message:

at Oxide.Plugins.RaidableBases.<LoadTable>m__F (Oxide.Plugins.RaidableBases+TreasureItem ti) [0x00000] in <cfa995b892084dcea746f8afeffeff88>:0

It's failing to load the loot tables, which are in the json data loot files. 

Share this comment


Link to comment

The only files I changed were the diffculty_loot and only removed items, didn't add anything. No other files were changed. I'm guessing the "at Oxide.Plugins.RaidableBases.<LoadTable>m__F" means it's the Monday through Friday files? I never touched those and not sure as well. Don't know what TreasureItem is either in the loot files

Share this comment


Link to comment

image.png.e81e221c4ae20273e5bade2420fd5bd8.png

oxide/data/RaidableBases/Difficulty_Loot/Medium.json

this is your json error. null cannot be a value in loot tables, and is why NullReferenceException: Object reference not set to an instance of an object is thrown. i can confirm removing this fixes the issue. this isn't in the original package so i'm not sure how you managed to add that. simple fix though 🙂

  • Like 1

Share this comment


Link to comment

Lol how did I not see that and how did it get there haha. Wow, can't believe the .json editor/validator's that I used didn't catch that but then again, things aren't perfect. Thank you so much @ZEODE and @nivex for your help with my stupidity haha. Really appreciate all the work you have done nivex with these wonderful plugins.

  • Like 1
  • Love 1

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.5k

Customers

Total customers served.

78.5k

Files Sold

Total number of files sold.

1.5m

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.