Skip to content

0.6.0

Latest

Choose a tag to compare

@gilzoide gilzoide released this 21 Sep 12:02
· 4 commits to main since this release

Built platforms: Windows, Linux, macOS, iOS, Android, Web

Added

  • Support for constructing typed arrays in Lua using the idiom Array[some_type]()
  • Support for constructing typed dictionaries in Lua using the idiom Dictionary[key_type][value_type]()
  • Support for typed arrays, typed dictionaries and classes in exported properties:
    MyScript.exported_node_array = export(Array[Node])
    MyScript.exported_int_valued_dict = export(Dictionary[Variant][int])
    MyScript.exported_texture_property = export(Texture)
    -- or
    MyScript.exported_node_array = export({ type = Array[Node] })
    MyScript.exported_int_valued_dict = export({ type = Dictionary[Variant][int] })
    MyScript.exported_texture_property = export({ type = Texture })
  • is_instance_valid utility function when opening GODOT_UTILITY_FUNCTIONS library
  • Support for older Linux distros using GLIBC on par with Ubuntu 22.04
  • Parser API based on Tree Sitter
    • Adds the LuaParser, LuaAST, LuaASTNode and LuaASTQuery classes

Changed

  • LuaScriptInstance's data table is passed as self to methods instead of their owner Object
    • For this to work, the table now has a metatable to access its owner when necessary
  • LuaScripts now have a "Import Behavior" property, defaulting to "Automatic"
    • In "Automatic" behavior, Lua code is evaluated only if it looks like a Godot script.
      Lua code that looks like a Godot script is one that ends by returning a named variable (return MyClassVariable) or a table constructed inline (return {...})
    • In "Always Evaluate" behavior, Lua code will always be evaluated
    • In "Don't Load" behavior, Lua code will not be loaded nor evaluated at all
    • Note that only evaluated scripts can be attached to Godot Objects.
  • Variant and LuaScriptInstance methods are now converted to Callable, so they can be more easily passed to Godot APIs such as Signal.connect
    -- Before this change, we had to manually instantiate Callable
    some_signal:connect(Callable(self, "method_name"))
    -- Now we can pass the method directly
    some_signal:connect(self.method_name)

Fixed

  • Fixed cyclic references from LuaScriptInstance <-> LuaState, avoiding leaks of LuaScripts
  • Fixed cyclic references from LuaScriptProperty <-> LuaState, avoiding memory leaks
  • Support for built-in Variant types in exported properties when passed directly to export:
    MyScript.exported_dictionary = export(Dictionary)
  • Convert null Object Variants (<Object#null>) to nil when passing them to Lua
  • Convert freed Object Variants (<Freed Object>) to nil when passing them to Lua
  • Fixed LuaJIT core/library version mismatch errors in LuaJIT builds
  • LuaScriptResourceFormatLoader::_load now respects the cache mode, fixing "Another resource is loaded from path 'res://...' (possible cyclic resource inclusion)." errors
  • Error messages from Lua code using the wrong stack index
  • Crashes when passing Lua primitives to typeof, Variant.is, Variant.get_type, Variant.booleanize, Variant.duplicate, Variant.get_type_name, Variant.hash, Variant.recursive_hash and Variant.hash_compare
  • The addons/lua-gdextension/build/.gdignore file was added to the distributed build.
    This fixes import errors when opening the Godot editor with the LuaJIT build.