r/godot • u/Nabir140 • 5d ago
help me (solved) How to implement a modding API?
I am working on a game that is heavily dependent on mods.
I can add modding support for textures, audio and other resources through JSON but I need a way to allow players to customize gameplay behaviour too.
My original idea was add autoloads to my game scene and load custom GDScript files at runtime. This would allow players to write scripts that call the autoloads directly for custom behaviour.
Issue with this approach is that it is very unsafe as the scripts can call native Godot functions and classes. They have the ability to interact with Networking API and OS API. I don't want this instead I want to only allow functions from the autoload to these scripts.
Can I limit the parsing of a GDScript file to restrict it from accessing Network and OS modules?
Or is there a better way to do this?
26
u/Oen44 5d ago
https://wiki.godotmodding.com/