[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: EonaStellar.ProgressionPortals.FileIO.ReadConfig () (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0) EonaStellar.ProgressionPortals.ProgressionPortals..ctor () (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.GameObject:.cctor() Fishlabs.Common.SingletonMonoBehaviour`1:get_Instance() Fishlabs.PlatformManagerInitializer:OnRuntimeMethodLoad()
and the following error while in-game:
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: EonaStellar.ProgressionPortals.InventoryTeleportablePatch.Prefix (System.Boolean& __result, Inventory __instance) (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0) (wrapper dynamic-method) Inventory.DMD<Inventory::IsTeleportable>(Inventory) Humanoid.IsTeleportable () (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0) TeleportWorld.UpdatePortal () (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
I am also unable to open a chest with this mod installed and get this error anytime I click on a chest to open it:
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object Stack trace: EonaStellar.ProgressionPortals.ContainerInteractPatch.Prefix (Container& __instance) (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0) (wrapper dynamic-method) Container.DMD<Container::Interact>(Container,Humanoid,bool,bool) (wrapper dynamic-method) Player.DMD<Player::Interact>(Player,UnityEngine.GameObject,bool,bool) (wrapper dynamic-method) Player.DMD<Player::Update>(Player)
Looks like it didn't load the config properly so the requirements table didn't get populated. What does the config folder and the config files look like on your machine?
This was from the initial install, so there was no config. After exiting the game with these errors, the config file was created inside "BepInEx\config\ProgressionPortals" (folder created by mod dll) and is titled "ProgressionPortals.config" and is listed as a CONFIG type file.
Opening this file in notepad++ shows only the following text:
CheckAllItems=false BlockByDefault=false
seems like the config file was not created properly on the initial launch. I deleted the file and tried to launch it again, but it gave the same errors and incorrect config file.
Can you upload a config file that I can put in the folder to see if that works? There may be a mod conflict that is preventing your mod from creating the config file properly, but I have 60+ mods running so it would be difficult to figure out where the conflict is.
This feature is something I have been looking for since this game launched, so I would love to get this to work!
The ProgressionPortals.config file looks like it's right but it sounds like TeleportRequirements.config isn't generating properly. I'll upload the default config files right now then see about fixing the file generation issue.
Edit: The default config files are now uploaded in the Miscellaneous files section.
I'm still having this issue, even after creating the folder & files. I saved & restarted the game a couple times with & without the mod. I could look into fixing the mod if you're wiling to share the code? (software engineer 8+ years)
Sadly i can't vote for this. If i wasn't building atm i'd instantly add this. Simple solution for an annoying circumstance without ruining the flow of progress. Brilliant. Definetely tracking for when my castle is done and the King (me) is ready for adventure xD
Hiya, I am playing with some friends on a world and wanted to try this addon out.
We installed it like we have other mods, but for some reason, we can't open any chests while using this mod. Did we do something wrong on our side, or could there be some incapability with another mod? We haven't got any too many mods installed, only the equipment slots one, and a farming grid one for our resident farmer.
This sounds like an issue that version 1.1.0 had that I fixed in version 1.1.1. Basically, the TeleportRequirements.config file was not being generated properly which caused the mod to not populate the teleport requirements lookup table. You should be able to fix it by using 1.1.1 or by adding the default TeleportRequirements.config file to your BepInEx\config\ProgressionPortals folder. Both default config files can be found in the download section.
If that doesn't fix the issue, please let me know!
I never encountered this error while testing it, but I did find a reddit post with some similar error messages: https://www.reddit.com/r/valheim/comments/uxzmkn/bepinex_error_on_dedicated_server/.
That said, this mod is client-side only so I suspect installing it on a server may be what is causing the issue. I'm planning to add server sync in the future to ensure all players on a server are running the mod with the same config but right now it's on a per-client basis.
This is a great idea. I was using another mod to allow specific items (refined metals) thru the portal while not allowing others (ore, scrap), but this adds another level.
Is there a way to completely block or allow items? Ex., block Dragon Eggs or allow Iron pits? Right now I can use the Crypt Key to allow and Queen drops to block, but having an enable/disable option would be nice.
Can we add any item to the list by adding a new item line to the config?
Edit: Looks like taking the item line out of the config allows you to take the item thru the portal unrestricted. Removing the requirement (eg., $item_cryptkey) prevents the item from being taken thru the portal completely.
Hi! Removing an item's line from the config should have prevented it from being teleported entirely, though this wasn't a use case I considered when testing it so I seem to have missed it. I will update it shortly to correct this, and add the ability to leave the required item section of a item's line blank so it is always allowed. I suppose if you want to block one completely, you could set the requirement to a fake item that doesn't exist since there's no way the player could obtain such an item.
You can add any items you like in the config file, but only items that are not teleportable are checked currently to reduce the number of lookups being done every time you open an inventory. I will create a second config file with an option to bypass this and allow any item to be blocked.
Leave the requirements for an item blank to make it always allowed.
Enable CheckAllItems to allow requirements on items that are typically teleportable. If disabled, the mod only checks items that are typically teleport-blocked.
Set an impossible requirement to block an item entirely, like using the word "never" or something.
Removing a line from the requirements file can do a few different things. If CheckAllItems is false, it will revert the teleportability to the item's default. If CheckAllItems is true, anything not listed in requirements is always teleportable. If CheckAllItems and BlockByDefault are both true, any item not listed cannot be teleported and only items with satisfied requirements can be teleported.
I don't know anything about writing mods, but there is a player key set when a boss is killed. I have GP_TheElder and GP_Eikthyr in my player keys. Maybe use those to determine what can go thru a portal? I like the idea of it being player based rather than global.
I had considered going that route but everything about bosses I could find was either global or was the forsaken powers that the player has had at any point, stored in the player's unique keys. The issue with using the unique keys is that a player that has defeated no bosses but is on a server where bosses have been defeated could just get the power near the spawn to meet the teleportation requirements.
Agreed. Didn't realize the GP keys were forsaken power. Be so much easier if they put the defeated boss keys in the player sections, too.
Well, 1.0.0 is doing what I need based on the boss drops. I just won't tell anyone that's how it works, lol. The only other request I have is to add server-sync so players can't change their local settings when playing on a server.
20 comments
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
EonaStellar.ProgressionPortals.FileIO.ReadConfig () (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0)
EonaStellar.ProgressionPortals.ProgressionPortals..ctor () (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.GameObject:.cctor()
Fishlabs.Common.SingletonMonoBehaviour`1:get_Instance()
Fishlabs.PlatformManagerInitializer:OnRuntimeMethodLoad()
and the following error while in-game:
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
EonaStellar.ProgressionPortals.InventoryTeleportablePatch.Prefix (System.Boolean& __result, Inventory __instance) (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0)
(wrapper dynamic-method) Inventory.DMD<Inventory::IsTeleportable>(Inventory)
Humanoid.IsTeleportable () (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
TeleportWorld.UpdatePortal () (at <dbd2a6fbcde9498cadcacfb37ef883e3>:0)
I am also unable to open a chest with this mod installed and get this error anytime I click on a chest to open it:
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
EonaStellar.ProgressionPortals.ContainerInteractPatch.Prefix (Container& __instance) (at <88c2eb973d3a41e7a2ec26ef2c45ee6c>:0)
(wrapper dynamic-method) Container.DMD<Container::Interact>(Container,Humanoid,bool,bool)
(wrapper dynamic-method) Player.DMD<Player::Interact>(Player,UnityEngine.GameObject,bool,bool)
(wrapper dynamic-method) Player.DMD<Player::Update>(Player)
Opening this file in notepad++ shows only the following text:
CheckAllItems=false
BlockByDefault=false
seems like the config file was not created properly on the initial launch. I deleted the file and tried to launch it again, but it gave the same errors and incorrect config file.
Can you upload a config file that I can put in the folder to see if that works? There may be a mod conflict that is preventing your mod from creating the config file properly, but I have 60+ mods running so it would be difficult to figure out where the conflict is.
This feature is something I have been looking for since this game launched, so I would love to get this to work!
Edit: The default config files are now uploaded in the Miscellaneous files section.
We installed it like we have other mods, but for some reason, we can't open any chests while using this mod. Did we do something wrong on our side, or could there be some incapability with another mod? We haven't got any too many mods installed, only the equipment slots one, and a farming grid one for our resident farmer.
If that doesn't fix the issue, please let me know!
Thank you for your mod.
Have you already encountered this issue ? :
[Message: BepInEx] BepInEx 5.4.22.0 - valheim_server (01/04/2024 22:04:57)
[Message: BepInEx] User is running BepInExPack Valheim version 5.4.2202 from Thunderstore
[Info : BepInEx] Running under Unity vUnknown (post-2017)
[Info : BepInEx] CLR runtime version: 4.0.30319.42000
[Info : BepInEx] Supports SRE: True
[Info : BepInEx] System platform: Bits64, Linux
[Message: BepInEx] Preloader started
[Info : BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.22.0]
[Info : BepInEx] 1 patcher plugin loaded
[Info : BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Message: BepInEx] Preloader finished
[Info : BepInEx] Detected Unity version: v2022.3.12f1
[Message: BepInEx] Chainloader ready
[Message: BepInEx] Chainloader started
[Info : BepInEx] 2 plugins to load
[Warning: BepInEx] Skipping [Progression Portals 1.1.0] because of process filters (valheim.exe)
[Info : BepInEx] Loading [Display BepInEx Info In-Game 2.0.2]
[Message: BepInEx] Chainloader startup complete
That said, this mod is client-side only so I suspect installing it on a server may be what is causing the issue. I'm planning to add server sync in the future to ensure all players on a server are running the mod with the same config but right now it's on a per-client basis.
Is there a way to completely block or allow items? Ex., block Dragon Eggs or allow Iron pits? Right now I can use the Crypt Key to allow and Queen drops to block, but having an enable/disable option would be nice.
Can we add any item to the list by adding a new item line to the config?
Edit:
Looks like taking the item line out of the config allows you to take the item thru the portal unrestricted. Removing the requirement (eg., $item_cryptkey) prevents the item from being taken thru the portal completely.
You can add any items you like in the config file, but only items that are not teleportable are checked currently to reduce the number of lookups being done every time you open an inventory. I will create a second config file with an option to bypass this and allow any item to be blocked.
Well, 1.0.0 is doing what I need based on the boss drops. I just won't tell anyone that's how it works, lol. The only other request I have is to add server-sync so players can't change their local settings when playing on a server.
Thanks for writing this mod!