cocolabs / pz-zmod

ZomboidMod is compact mod development environment for Project Zomboid.
MIT License
22 stars 1 forks source link

Support for modular mod structure #2

Open matshou opened 3 years ago

matshou commented 3 years ago

Project Zomboid supports modular mod structures for Steam workshop mods. Each mod uploaded to the workshop can contain other mods that can then be toggled on and off in the game mod menu.

Currently zmod does not support this modular structure and some features will not work.

Chuckleberry-Finn commented 3 years ago

To reiterate mod structure: /Users/<username>/Zomboid/Workshop/<main_mod_dir>/Contents/mods/<modular_mod_dir>

Note: workshop.txt can be modified during the in-game upload process.

matshou commented 3 years ago

We should start off with implementing support for simple features.

@ChuckTheSheep Do you know how is the mod.info handled? Does each modular mod directory contain it's own mod.info or is there a single master info file in the main mod directory. Currently the writeModInfo task updates the mod.info file in the project root directory and would need to be configured if there are mod info files.

Chuckleberry-Finn commented 3 years ago

Each modular mod directory has it's own mod.info, as well as a poster.png (again has to be png format and is expected to be sized to 512x512 but I believe the game allows for it to be stretched if needed), and of course the media folder.

matshou commented 3 years ago

For reference, here is the modular mod structure example you provided on Discord:

2021-02-10_15-30-01 2021-02-10_15-30-15 2021-02-10_15-29-33

matshou commented 3 years ago

Do you by any chance know exactly what files from Workshop/<mod> does Steam uploads to workshop? Is it just Contents, preview.png and workshop.txt or does it upload anything it finds in root directory?

We would want to avoid deploying project build files to workshop.

Chuckleberry-Finn commented 3 years ago

2021-02-10_18-09-51

This is the error I get when I try to upload my current directory. (There are similar errors if any of the files have an issue.)

matshou commented 3 years ago

This is the error I get when I try to upload my current directory. (There are similar errors if any of the files have an issue.)

I don't follow, what are you trying to upload and where?

EDIT: Okay, it was clarified on Discord.

matshou commented 3 years ago

@ChuckTheSheep Are we still going to work on this now that we agreed we are moving away from Steam?

Chuckleberry-Finn commented 3 years ago

Modular mod structure is still needed for mods which have optional features. I assume the modloader will make this less of a headache to implement?

matshou commented 3 years ago

Modular mod structure is still needed for mods which have optional features

Isn't this strictly a feature offered by Steam workshop, or the PZ integration with workshop?

I assume the modloader will make this less of a headache to implement?

We would need to think about the details of how we want to implement that feature with modloader.

Chuckleberry-Finn commented 3 years ago

I would have to double check how the local directory functions, but I believe there is still a <mod>/mods/<option1> structure even locally. I know steam downloads simply replaces the name of <mod> with the steam workshop ID. In any case, "support for modular mod structure" should still be something worth looking into I imagine.