Skip to content

v2.1-beta11

Latest
Compare
Choose a tag to compare
@Trey2k Trey2k released this 24 Jan 20:28
edf4afe

⚠️ This release of LuaAPI is for godot version 4.2.x

What's Changed

  • BREAKING: LuaAPI.do_file and LuaAPI.do_string both had their return types changed from LuaError to Variant. This is to allow for return values.
  • LuaAPI.do_file and LuaAPI.do_string both now take an optimal second argument. Which would be an Array of arguments to pass to the script.
  • Some minor documentation changes

Example usage:

func _ready():
    var lua: LuaAPI = LuaAPI.new()
    lua.bind_libraries(["base", "table", "string"])

    var ret = lua.do_string("""
    local a, b = ...
    print(a, b)
    return a + b
    """, [4, 6])
    if ret is LuaError:
        print("ERROR %d: %s" % [ret.type, ret.message])
        return
    
    print(ret)

Module MacOS actions started failing randomly so are sadly not included in this release.