{"id":13525786,"url":"https://github.com/WeaselGames/godot_luaAPI","last_synced_at":"2025-04-01T05:32:25.538Z","repository":{"id":37264911,"uuid":"351998623","full_name":"WeaselGames/godot_luaAPI","owner":"WeaselGames","description":"Godot LuaAPI","archived":true,"fork":false,"pushed_at":"2024-12-29T01:02:20.000Z","size":4379,"stargazers_count":412,"open_issues_count":0,"forks_count":38,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-26T01:03:43.992Z","etag":null,"topics":["game","game-development","gamedev","gdscript","godot","godot-engine","godot-module","lua","modding","sandbox","security"],"latest_commit_sha":null,"homepage":"https://luaapi.weaselgames.info","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WeaselGames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-27T06:21:46.000Z","updated_at":"2025-03-23T18:07:45.000Z","dependencies_parsed_at":"2023-10-14T19:49:32.699Z","dependency_job_id":"173c182b-ea1b-4309-937a-f53b5e89112b","html_url":"https://github.com/WeaselGames/godot_luaAPI","commit_stats":{"total_commits":280,"total_committers":11,"mean_commits":"25.454545454545453","dds":0.08571428571428574,"last_synced_commit":"edf4afe7665a03978e8a4a3a15b727a66c4dc03d"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeaselGames%2Fgodot_luaAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeaselGames%2Fgodot_luaAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeaselGames%2Fgodot_luaAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WeaselGames%2Fgodot_luaAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WeaselGames","download_url":"https://codeload.github.com/WeaselGames/godot_luaAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246591729,"owners_count":20801984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","game-development","gamedev","gdscript","godot","godot-engine","godot-module","lua","modding","sandbox","security"],"created_at":"2024-08-01T06:01:22.092Z","updated_at":"2025-04-01T05:32:25.532Z","avatar_url":"https://github.com/WeaselGames.png","language":"C++","readme":"# Archived!\n***WARNING!*** this repository has been archived for the time being. I do not have the time. If intrested in maintaining please start with a fork and contact me.\n \n Godot Lua API\n===============\n**Table of contents:**\n  * [About](#about)\n  * [Features](#features)\n  * [Release Builds](#release-builds)\n  * [Compiling](#compiling)\n  * [Getting Started](#getting-started)\n  * [Contributing And Feature Requests](#contributing-and-feature-requests)\n\nAbout\n-------\n![Logo](.github/LuaAPI.png)\nArt created by [Alex](https://www.instagram.com/redheadalex1)\n\nThis is a Godot addon that adds Lua API support via GDScript, C# or GDExtension. Importantly this is **NOT** meant to be a replacement for or alternative to GDScript. This addon provides no functionality to program your game out of the box. This addon allows you to create custom Modding API's in a sandboxed environment. You have control of what people can and can not do within that sandbox.\n\nTo use you can either [Compile from source](#compiling) or you can download one of the [release builds](#release-builds).\n\nBy default the Lua print function is set to print to the GDEditor console. This can be changed by exposing your own print function as it will overwrite the existing one.\n\n**Some things to note**, this is not the only way to support Modding in your game. It's also not the only way to support Lua Modding in your game. In fact, using this mod to create your Modding API will likely take a lot more work than using native scripts for Modding. However, the advantage using luaAPI over native scripts is that the Lua code is sandboxed. No one can access parts of the engine that you don't explicitly give access to.\n\nIf you are looking to make your game using Lua or would like to support Modding without worrying about a sandbox, check out one of these projects:\n- [luascript](https://github.com/perbone/luascript) by [perbone](https://github.com/perbone)\n- [godot-lua-pluginscript](https://github.com/gilzoide/godot-lua-pluginscript) by [gilzoide](https://github.com/gilzoide)\n\u003cbr /\u003e\n\nWe will supply a brief overview here. But for more info check out the [wiki](https://luaapi.weaselgames.info/latest).\n\nFor discussion related to this project feel free to join the Weasel Games [Discord](https://discord.gg/vGazqdQZ7p) or [Matrix](https://matrix.weaselgames.net/#/room/#weaselgames:weaselgames.net).\n\nFeatures\n--------------------------------\n- Run Lua directly from a string or a text file.\n- Push any Variant as a global.\n- Call Lua functions from GDScript.\n- Choose which libraries you want Lua to have access to.\n- LuaError type which is used to report any errors this addon or Lua run into.\n- LuaCoroutine type which creates a Lua thread. This is not a OS thread but a coroutine.\n- Object passed as userdata. See [wiki](https://luaapi.weaselgames.info/latest/examples/objects/).\n- Objects can override most of the Lua metamethods. I.E. __index by defining a function with the same name.\n- Callables passed as userdata, which allows you to push a Callable as a Lua function.\n- Basic types are passed as userdata (currently: Vector2, Vector3, Color, Rect2, Plane) with a useful metatable. This means you can do things like:\n```lua\nlocal v1 = Vector2(1,2)\nlocal v2 = Vector2(100.52,100.83)\nv2 = v2.floor()\nprint(v2.x) -- \"100\"\nprint(v1+v2) -- \"(101,102)\"\nchange_my_sprite_color(Color(1,0,0,1)) -- If \"change_my_sprite_color\" was exposed, in GDScript it will receive a Color variant.\n```\n\nIf a feature is missing that you would like to see feel free to create a [Feature Request](https://github.com/WeaselGames/godot_luaAPI/issues/new?assignees=\u0026labels=feature%20request\u0026template=feature_request.md\u0026title=) or submit a PR\n\nRelease Builds\n---------------\n- [⚙️ GDExtension](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/gdextension.zip)\n- [⚙️ GDExtension LuaJIT](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/gdextension-LuaJIT.zip)\n- [🐧 Linux Editor](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/linux-editor.zip)\n- [🐧 Linux Editor LuaJIT](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/linux-editor-luajit.zip)\n- [🐧 Linux Editor Mono](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/linux-editor.zip)\n- [🎨 Windows Editor](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/windows-editor.zip)\n- [🎨 Windows Editor LuaJIT](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/windows-editor-luajit.zip)\n- [🎨 Windows Editor Mono](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/windows-editor-mono.zip)\n- [🍎 MacOS Editor](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/macos-editor.zip)\n- [🍎 MacOS Editor LuaJIT](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/macos-editor-luajit.zip)\n- [🍎 MacOS Editor Mono](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/macos-editor-mono.zip)\n- [🗜️ Export Templates](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/export-templates.zip)\n- [🗜️ Mono Export Templates](https://github.com/WeaselGames/godot_luaAPI/releases/latest/download/export-templates-mono.zip)\n- For previous versions see [releases](https://github.com/WeaselGames/godot_luaAPI/releases)\n\nCompiling\n------------\nThis build is for godot 4.1.\n- Start by cloning the Godot 4.1 [source](https://github.com/godotengine/godot) with this command `git clone https://github.com/godotengine/godot`\n- Next change directories into the modules folder and clone this repo into a folder named luaAPI with this command `git clone --recurse-submodules https://github.com/WeaselGames/godot_luaAPI luaAPI`. Make sure to use --recurse-submodules to pull the submodules as well.\n\n- Now you can follow the Godot build instructions on their [site](https://docs.godotengine.org/en/stable/contributing/development/compiling).\n\nGetting Started\n------------\nIf you are looking for more in depth information please refer to our [wiki](https://luaapi.weaselgames.info/latest).\n\nPro Tip: Be sure to download the Export Templates! The Export Templates that come with Godot will not work with this \nEditor/Add-on. Please see [Installing Export Templates](EXPORT.MD) for more information. \n\nDotnet users will also want to refer to [DOTNET.md](DOTNET.md) For additional information and steps that are needed to \nmake the Editor/Add-on work.\n\n**Running Lua for you first time:**\n```gdscript\nextends Node\n\nvar lua: LuaAPI = LuaAPI.new()\n\nfunc _lua_print(message: String) -\u003e void:\n\tprint(message)\n\nfunc _ready() -\u003e void:\n\tlua.push_variant(\"print\", _lua_print)\n\tlua.push_variant(\"message\", \"Hello lua!\")\n\n\t# All builtin libraries are available to bind with. Use OS and IO at your own risk.\n\tlua.bind_libraries([\"base\", \"table\", \"string\"])\n\n\t# Most methods return a LuaError in case of an error\n\tvar err: LuaError = lua.do_string(\"\"\"\n\tfor i=1,10,1 do\n\t\tprint(message)\n\tend\n\tfunction get_message()\n\t\treturn \"Hello gdScript!\"\n\tend\n\t\"\"\")\n\tif err is LuaError:\n\t\tprint(\"ERROR %d: %s\" % [err.type, err.message])\n\t\treturn\n\n\tvar val = lua.pull_variant(\"get_message\")\n\tif val is LuaError:\n\t\tprint(\"ERROR %d: %s\" % [val.type, val.message])\n\t\treturn\n\n\tvar message = val.call([])\n\tprint(message)\n```\n\nDotnet (mono) users see example redone in C# in [DOTNET.md](DOTNET.md).\n\nContributing And Feature Requests\n---------------\nAll contributions are welcome, if you would like to contribute submit a PR.\n\u003cbr /\u003e\nAdditionally if you do not have the time and or the knowledge you can create a [Feature Request](https://github.com/WeaselGames/godot_luaAPI/issues/new?assignees=\u0026labels=feature%20request\u0026template=feature_request.md\u0026title=).\n\n[![lua logo](https://www.lua.org/images/powered-by-lua.gif)](https://www.lua.org/)\n","funding_links":[],"categories":["Modules"],"sub_categories":["3D"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWeaselGames%2Fgodot_luaAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWeaselGames%2Fgodot_luaAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWeaselGames%2Fgodot_luaAPI/lists"}