You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2022. It is now read-only.
I don't know what I did to get the module to work (probably the part where I renamed the gdns file to LuaScript.gdns instead of just Lua.gdns). This is aside from my merging the latest commit of Godot 3.2-dev with my copy of Godot (which fixed a freeze on all GDNativeLibraries).
However, I noticed loading an invalid Lua file freezes the game as a whole.
Trying to load this file causes the freeze.
local class = require 'lua.class' -- Import the system class library
godot.Node = require 'godot.Node' -- Make sure to import the base class
local NewScript = class.extends(godot.Node) -- Create the user subclass
function NewScript:_ready()
print("Hello Lua")
end
function NewScript:_process(delta)
end
function NewScript:command(variable)
return "Variable: %s" % variable
end
function NewScript:get_class()
return "Test Lua"
end
return NewScript
This file works fine.
function sum(...)
result = 0
local arg = {...}
for i,v in ipairs(arg) do
result = result + v
end
return result
end