Skip to content
Discussion options

You must be logged in to vote

Hey @Acanixz, thanks for the question.

When executing code via a LuaState (for example, using lua.do_string), am I correct that the code is treated as a Lua table rather than a full Godot script? I noticed it can’t use Godot-specific keywords like export or signal.

When you use do_string, the code will be loaded and executed right away, just like if you loaded the chunk in Lua with load and called the returned function. If your script returns a table, then yeah the result of running such code with do_string would be a LuaTable.

But anyway, you are correct, you only have a "full Godot script" if you load it as a Resource in Godot (like var lua_script = load("res://some_lua_script.lua")) …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Acanixz
Comment options

Answer selected by Acanixz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants