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

Add support for loading unpacked ZIPs #10

Merged
merged 4 commits into from
Jan 4, 2023

Conversation

ithinkandicode
Copy link
Collaborator

@ithinkandicode ithinkandicode commented Jan 4, 2023

This is a major update:

  • Adds support for loading unpacked mods without ZIPs.
    • This lets you work on mods in the Godot editor, without needing to pack them into ZIPs for testing.
    • This also makes ZIP filenames arbitrary, which is helpful if you release ZIPs with versioned affixes
  • Loads ZIP contents into the root
    • This handles importing files in your mod ZIP's .import folder, and matches the file system structure in the editor.
  • Adds doc comments to every func.
  • Optimizes the mod load process by disabling an expensive function that loops over files.

I've also updated the docs to recommend putting extender scripts in a dir named "extensions". This helps keep your mod folder tidy, as all extender scripts are separate from your mod's core files (eg ModMain.gd).

Breaking Changes

This update changes the way mod ZIPs are structured. I've updated the README.md to describe their new structure. In short, the zip's filename is now arbitrary, and the contents of the ZIP are loaded into the root. A mod's own files should be included in a folder called "mods-unpacked", and internal references to your mod's files should follow that path, eg:
res:https://mods-unpacked/Author-ModName/ModMain.gd

Here's an example ZIP:

Brotato-VersionString.zip

And here's how it looks when editing a Brotato project:

image

Copy link
Member

@otDan otDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked thru it quickly and tested the provided build on discord, everything seems to be working correctly.

@ithinkandicode
Copy link
Collaborator Author

ithinkandicode commented Jan 4, 2023

Closes #2
Closes #3
Closes #7

@ithinkandicode
Copy link
Collaborator Author

Compiled PCK for Brotato:
https://brotato.codemuffin.com/_files/Brotato--ModLoader-2.0.0.pck

ZIP of a few Brotato mods for testing (ContentLoader, Invasion, VersionString):
https://brotato.codemuffin.com/_files/mods.zip

Copy link
Member

@KANAjetzt KANAjetzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing stuff 👍
I will test it with my mods real quick and merge it 👍

loader/mod_loader.gd Outdated Show resolved Hide resolved
loader/mod_loader.gd Show resolved Hide resolved
loader/mod_loader.gd Show resolved Hide resolved
@KANAjetzt
Copy link
Member

Closes #2 Closes #3 Closes #7

We will have to keep #3 open until we find a solution for extending scripts in the editor.

@KANAjetzt KANAjetzt merged commit aa0d24d into GodotModding:main Jan 4, 2023
@ithinkandicode ithinkandicode changed the title 2.0.0 - Add support for loading unpacked ZIPs Add support for loading unpacked ZIPs Jan 15, 2023
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

Successfully merging this pull request may close these issues.

3 participants