-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Implement GDScript mod loading #2861
Comments
Could gdscript mods start execution the same as c# mod by calling a initialize function? |
How do you instantiate a gdscript class, then? I don't know how that would work, that's why I suggested the approach of attaching a basically an "autoload" from the mod to the Scene tree, then the ready method in the gdscript file for that scene can run. |
to create the script you have load it using the ResourceLoader as a 'GDScript' and then use the '.new()' function to create a new instance of the script and then you can call the intilize function using the '.call()' function docs you can view:
this is the way i did it in my personal modloader, though only GdScript worked:
|
That's a pretty interesting approach. |
probably not beside making everything work the same |
From some investigation it seems that gdscript mods can't start executing by themselves, we need to add a new property in the ModInfo to specify that a scene should be loaded and attached to the root node from a mod. This should allow gdscript made code mods to load.
After this works an example mod should be made: Revolutionary-Games/ThriveMods#5
and instructions updated: https://wiki.revolutionarygamesstudio.com/index.php?title=Modding
The text was updated successfully, but these errors were encountered: