godot-luaAPI
godot-luaAPI is a Godot addon that enables Lua API support via GDScript, C#, or GDExtension for creating sandboxed modding environments. It is designed for custom modding APIs where you have control over the sandbox environment.
https://github.com/WeaselGames/godot_luaAPIPreview Images


godot-luaAPI: Adding Lua Scripting Capabilities to Godot
godot-luaAPI is a Godot addon designed to integrate Lua scripting capabilities into your Godot projects. This addon allows developers to create custom Modding APIs in a sandboxed environment, giving them fine-grained control over what modders can access and modify. It supports integration via GDScript, C#, or GDExtension, providing flexibility for different project setups.
Key Features
- Lua Integration: Run Lua code directly from strings or text files within your Godot project.
- Variant Handling: Push any Godot Variant as a global variable into the Lua environment.
- GDScript Interoperability: Call Lua functions directly from GDScript, facilitating seamless communication between the two languages.
- Library Control: Choose exactly which Lua libraries are accessible to the scripts, enhancing security and control.
-
Error Handling: Utilizes a
LuaError
type to report errors encountered during Lua execution or within the addon. -
Coroutines: Implements
LuaCoroutine
for creating Lua threads (coroutines) to manage concurrent tasks. -
Metamethod Overriding: Objects passed to Lua can override metamethods like
__index
.
Sandboxed Modding
The primary advantage of using godot-luaAPI is the sandboxed environment it provides for modding. Unlike native scripting, Lua code executed through this addon is restricted, preventing access to engine components that are not explicitly exposed. This ensures that mods cannot compromise the integrity or security of the game.
Getting Started
To use godot-luaAPI, you can either compile it from source or download pre-built release versions. The addon is compatible with Godot 4.1 and supports various platforms, including Linux, Windows, and macOS. Detailed instructions on compiling and setting up the addon can be found in the project's wiki.