Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example does not work #5

Open
YunaBraska opened this issue Mar 18, 2022 · 5 comments
Open

Example does not work #5

YunaBraska opened this issue Mar 18, 2022 · 5 comments

Comments

@YunaBraska
Copy link

YunaBraska commented Mar 18, 2022

Hi, i am trying since months to create a Valheim mod without success.
Now i am trying your awesome library but again also here no success.

  1. First issue is, that i also need to copy the jotunn.dll to my valheim mod folder. Thats done. Now the mod is loaded.
  2. The mod stats with exceptions.
[Info   :  HarmonyX] Writing prefixes
[Info   :    Jotunn] Jötunn v2.5.1 loaded successfully
[Info   :   BepInEx] Loading [JotunnModExample 2.4.5]
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
JotunnModExample.JotunnModExample.LoadAssets () (at /JotunnModExample.cs:454)
JotunnModExample.JotunnModExample.Awake () (at /JotunnModExample.cs:88)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Application:.cctor()

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ZInput.IsMouseActive () (at <e2ad8b24c5224f5a8365347f64597ff3>:0)
FejdStartup.UpdateCursor () (at <dcb0de0155834d459f18d7ac6ea5244b>:0)
(wrapper dynamic-method) FejdStartup.DMD<FejdStartup::Update>(FejdStartup)

[Error  : Unity Log] MissingMethodException: ZInput/ButtonDef ZInput.AddButton(string,string,bool,single,single)
Stack trace:
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Hook<ZInput::Load>?2105261312(ZInput)
ZInput..ctor () (at <e2ad8b24c5224f5a8365347f64597ff3>:0)
ZInput.Initialize () (at <e2ad8b24c5224f5a8365347f64597ff3>:0)
(wrapper dynamic-method) FejdStartup.DMD<FejdStartup::Start>(FejdStartup)
  1. The game menu breaks
@sirskunkalot
Copy link
Member

Did you copy the "Assets" folder into your BepInEx' plugin folder, too? Looks like the example can't read them. Although that should happen automatically when building the project in Visual Studio.

Also the latest Jötunn version is needed (v2.6.0). I pushed a change right now for this solution to use the latest Jotunn version. So if you copied the one loaded by NuGet, you should pull the latest changes and try again.

@YunaBraska
Copy link
Author

YunaBraska commented Mar 21, 2022

Yes would be awesome if things happening automatically :D For me it wasn't the case, it was only deploying/copying one mod.dll file
I tried to copy the assets by my self as well but into BepInEx/plugins/JotunnExampleMod folder which did not work.
I will try to update today and tell you then it it worked.
As this is also a good thing to know, do you have a documentation of how to release the mod to Vortex. Like wich filled and structure it needs?

@YunaBraska
Copy link
Author

Unfortunately it still doesn’t work even after updating the project and nuget packages. Also copying assets manually didn’t help or I moved it to a wrong path. No idea. I am really a noob here. At least I got in a new project your color picker to work :)

@YunaBraska
Copy link
Author

Okay I just recognized that the errors still exists but actually some things seem to work. E.g. I got a new menu item from the example mod.

@dani-beltran
Copy link

Having issues as well running the Jotunn example.
I copied Assets, but now I get this error message

[Error  :Jotunn.Utils.AssetUtils] Error, failed to load contents from non-existant path: $D:\SteamLibrary\steamapps\common\Valheim\BepInEx\plugins\JotunnModExample/Assets/recipes.json
[Error  :Jotunn.Managers.ItemManager] Failed to load recipes from invalid JSON: JotunnModExample/Assets/recipes.json

The JSON file looks fine to me 🤷

[
  {
    "Item": "Blueberries",
    "Amount": 1,
    "Requirements": [
      {
        "Item": "Stone",
        "Amount": 2
      },
      {
        "Item": "Wood",
         "Amount": 1
      }
    ]
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants