GodotModding / godot-mod-loader

A general purpose mod loader for GDScript based Godot Games [3.x/4.x]
https://discord.godotmodding.com
Creative Commons Zero v1.0 Universal
325 stars 26 forks source link

Mod loading version priority #249

Open otDan opened 1 year ago

otDan commented 1 year ago

Load only higher versions of the same mod Not sure how we should do that since unpacking the pck will always lead to the resources overwriting themselves meaning we can't check the version One thing I thought was to check the file date, but let me know if there would be a better way

aesereht commented 1 year ago

You could try getting the metadata from file to determine it (or even setting custom one when creating them), but the simplest soloution would be if zip files would have same name. Then when downloading new version it would simply overwrite, and there would be no problem with determination of the version, but for that to work you would just need to keep mod to only contain itself and not the dependent mods, so every dependencity would need to be independent mod.

Other thing I can think of is that zip itself is structure in a way that it should be able to list all files without extracting them. For Godot 4.x they implemanted this https://docs.godotengine.org/en/4.0/classes/class_zipreader.html so it's quite easy For Godot 3.x I found the addon that lets you load the zip without uncompessing it so you can get file list name or uncompress specific file https://git.sr.ht/~jelle/gdunzip/tree/main/item/addons/gdunzip/gdunzip.gd

KANAjetzt commented 11 months ago

For 3.x, I would add a check after the mod zip is unpacked via the manifest and live with the fact that if the zip name is the same, it will override itself (maybe we can provide some indication that this is happening?).

For 4.x, we can open a separate issue to investigate how we can use ZipReader to solve this.