SGG-Modding / Hell2Modding

Mod loader for Hades 2
MIT License
12 stars 2 forks source link

Alternative plugin structure handling #6

Closed AndreLouisIssa closed 2 months ago

AndreLouisIssa commented 3 months ago

Currently, the plugin structure is ideal for automatic installation with r2modman, this is obviously a priority.

But, there are other ways to install plugins that we may want to care about:

  1. Cloning from upstream/working from source

    • in our source repos we do not have a manifest.json, but rather a thunderstore.toml
    • H2M should be able to read the thunderstore.toml to get the same information it would from manifest.json
    • also within the source repos is the src folder, which should not be unpacked, but should be read as if it was unpacked
    • if it were unpacked, it would not work with hot reloading, and it would add more to be put in .gitignore
    • practically I think this just means that instead of just looking for main.lua, it also looks for src/main.lua
    • if H2M finds the main.lua in src, it should change _PLUGIN.plugins_mod_folder_path to include src
    • plugins using this method will just have to be careful to use that instead of combining rom.paths.plugins_mod_folder with _PLUGIN.guid
    • that is rather complicated, but the friction between developing, testing, and uploading is a very real problem
  2. Manual installation/unpacking downloaded zips

    • the thunderstore UI provides the option to manually download packages
    • but some packages contain the special inner folders such as plugins (and config and plugins_data?)
    • this makes them unsuitable for manual install
    • H2M could look within plugins for these special folders
    • in most cases it should suffice that the folders are unpacked like r2modman would do
    • devs having issues with this would just enclose their inner folders in src to get around it, but users can't do that
xiaoxiao921 commented 2 months ago

Not really an issue about Hell2Modding but more an issue about the tooling around the template, some example for fixing such issues and the friction you are talking about:

Usage:

.\script.ps1 -sourceFolder "C:\Users\<USERNAME>\Desktop\hades2-mod-template" -pluginsFolder "C:\Users\<USERNAME>\AppData\Roaming\r2modmanPlus-local\HadesII\profiles\<PROFILENAME>\ReturnOfModding\plugins"

script.txt