-
Sorry if this is an obvious question. If I'm using Here is a very basic script I am running on an otherwise empty scene. func _ready():
var lua:LuaState = LuaState.new()
lua.open_libraries(LuaState.LUA_BASE)
var chunk = "print('Hello World!')" # Lua's print
print(lua.do_string(chunk)) # Godot's print
print(lua.do_string("return 'Goodbye!'")) On running the scene, Godot's output console displays:
Where is Lua's |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @ac-marshy, thanks for the question. Ok, so by default, Lua's print function prints the contents to the process's (in this case the Godot editor or game) standard output. If you open them from a terminal (or cmd or powershell in Windows), you should see the contents printed in the terminal. When you play a game from the Godot editor, if you can't see the output, its likely that the game's standard output is not connected to the editor (and this is in Godot's side). We need Godot's When you open only the LUA_BASE library, you only have Lua's # Using printt here because it matches Lua's `print` behavior of adding "\t" between arguments
lua.globals["print"] = printt |
Beta Was this translation helpful? Give feedback.
Hey @ac-marshy, thanks for the question.
Ok, so by default, Lua's print function prints the contents to the process's (in this case the Godot editor or game) standard output. If you open them from a terminal (or cmd or powershell in Windows), you should see the contents printed in the terminal. When you play a game from the Godot editor, if you can't see the output, its likely that the game's standard output is not connected to the editor (and this is in Godot's side). We need Godot's
print
functions to get stuff into the Output tab.When you open only the LUA_BASE library, you only have Lua's
print
. When you open GODOT_UTILITY_FUNCTIONS, on the other hand, you get Godot'sprint
function …