godot-mod-loader icon indicating copy to clipboard operation
godot-mod-loader copied to clipboard

Tracker: Godot 4.x support with class_names

Open matmanna opened this issue 2 years ago • 11 comments

I'm building a game for a tutorial series I am developing with Godot 4.0 and I am interested in adding godot mod loader to it. However, I found that it was not available for Godot 4.0. Is anyone planning on porting it? Thanks,

matmanna avatar Jul 02 '23 00:07 matmanna

there are plans for it already, but since no game release on steam that is currently interested in modding uses godot 4, it isn't a priority

otDan avatar Jul 02 '23 14:07 otDan

I've created a branch for it, you can follow development: https://github.com/GodotModding/godot-mod-loader/tree/4.x

otDan avatar Jul 02 '23 17:07 otDan

I've created a branch for it, you can follow development: https://github.com/GodotModding/godot-mod-loader/tree/4.x

Thank you!

matmanna avatar Jul 02 '23 19:07 matmanna

Looking forward the port!

0xIonRod avatar Jul 15 '23 06:07 0xIonRod

base version is in, now it just needs extensive testing to see if everything is working as expected

otDan avatar Jul 17 '23 01:07 otDan

I'm also interested in using this great plugin for my game in G4

Dark-Peace avatar Jul 25 '23 06:07 Dark-Peace

I will also use this for a game I am developing with Godot 4.

CodingPfeffer avatar Sep 25 '23 20:09 CodingPfeffer

So far the only Godot Modding plugin that supports Godot 4 that i could find (outside of the branch that was created: https://github.com/GodotModding/godot-mod-loader/tree/4.x) is this: https://github.com/KoBeWi/Godot-Universal-Mod-Manager

Alvarden15 avatar Oct 26 '23 17:10 Alvarden15

Yep. But gumm will have the exact same problem, since it also uses take_over_path to mod scripts - just like we do

Qubus0 avatar Oct 26 '23 17:10 Qubus0

Update about the 4.x Loader

  • The 4.x branch is now on par with the main branch (v6.2.0).
  • We currently have one massive blocker, there is a bug that prevents extending a named class after it has been taken over with take_over_path.
  • We reported this bug and opened a PR with a possible fix:
    • https://github.com/godotengine/godot/issues/83542
    • https://github.com/godotengine/godot/pull/84148
  • There is hope that it will be fixed with version 4.3.

What does this mean for the current 4.x branch?

  • For most games, the ease of use of the 3.5 loader is gone.
  • The game dev or modder interested in using the current 4.x loader version has to ensure that a named class is only extended once.
  • This can be achieved by creating an "API Mod" that all other mods use.
  • Some experiments to make this process easier are here:
    • https://github.com/GodotModding/godot-mod-loader/pull/347
    • https://github.com/GodotModding/godot-mod-tool/pull/105
    • (I dropped the development on this to focus on finding the issue in the engine, but let me know if anything seems interesting)
  • So just free-form modding with 4.x will currently most likely end up crashing your game with more than 1 mod installed.

Anything else?

  • Yes, https://github.com/GodotModding/godot-mod-loader/issues/345
  • "Parser Error: Class "ClassName" hides a global script class." I think the only reason why this works in Godot 3.x is that there is no check for that there. So we have to scrap the script saving in 4.x or come up with a solution to save them without triggering this parse error.

KANAjetzt avatar Nov 24 '23 21:11 KANAjetzt

renamed since the mod loader (4.x branch) can be used as normal as long as no class_names are used - as proven by Windowkill

Qubus0 avatar Sep 02 '24 14:09 Qubus0

The current 4.x branch has mod hooks implemented, and class_names are now supported 🎉
The 4.x branch and mod hooks are still in active development, so things might change. Documentation is currently being worked on. For now, the comments in ModLoaderMod explain the basics.

KANAjetzt avatar Jan 28 '25 10:01 KANAjetzt

Scripts with class_name still can't be extended using take_over_path / script extensions. As a workaround, we introduced Mod Hooks in #408. More details can be found on the Wiki.

Closed by #408

KANAjetzt avatar Feb 19 '25 10:02 KANAjetzt