thegreyham / Valheim.CookingSkill

MIT License
2 stars 1 forks source link

[v1.1.8] Current packing method for Thunderstore export causes asset loading failure #3

Closed NeonCarbide closed 3 years ago

NeonCarbide commented 3 years ago

Basically, the way the mod is currently being packed for export, as in the .zip file structure, is causing the mod to not be able to find the 'assets' directory as it is not being created.

The current packing method results in the following mod directory upon install using the r2modmanager:

/BepInEx
  /plugins
    /thegreyham-CookingSkill
      CookingSkill.dll
      manifest.json
      README.md
      icon.png
      meat-cooked.png

I'm assuming the desired outcome is this:

/BepInEx
  /plugins
    /thegreyham-CookingSkill
      /assets
        meat-cooked.png
      CookingSkill.dll
      manifest.json
      README.md
      icon.png

To achieve this, the mod has to be packed for Thunderstore like so:

/plugins
  /assets
  CookingSkill.dll
manifest.json
README.md
icon.png

This results in the 'assets' directory actually being created within the mod's install directory in the profile.

thegreyham commented 3 years ago

Thanks @NeonCarbide for you're feedback. TBH Thunderstore is a pain to use. I only uploaded to Thunderstore as some people reached out to make the mod part of a mod pack. So I obliged. I have made some updates to the functionality of the mod and have repacked it based on your suggestions. Let me know how you get on.

NeonCarbide commented 3 years ago

You were close with the packing method, but it's still resulting in a failure to load the skill icon image.

Basically, if r2modmanager finds the 'plugins' directory within a mod .zip, it will maintain the file structure that you have inside the 'plugins' directory in your mod .zip when it installs the mod to the profile.

The only ways I know of fixing this problem are either to change the code so that the image is loaded from the same directory as the .dll or simply pack the mod .zip like so:

manifest.json
README.md
icon.png
/plugins
  CookingSkill.dll
  /assets
    meat_cooked.png

I will say, I am glad you decided to upload it to Thunderstore, as I am also a modpack dev.

I do understand the frustrations with Thunderstore though. I have to maintain two different manifest.json versions, one for uploading the modpack to Thunderstore, and one for converting NexusMods mods to versions you can drag'n'drop install in r2modmanager. I also think that r2modmanager should just maintain file structure on install in the first place, as I really don't understand the need for full extraction in the first place.

thegreyham commented 3 years ago

Should be resolved with the latest update of 1.2.0 https://valheim.thunderstore.io/package/thegreyham/CookingSkill/1.2.0/

Thanks for your assistance with this.

NeonCarbide commented 3 years ago

It is indeed resolved in 1.2.0.

Thanks for all your work on the mod, it's been pretty nice to have ^-^.