tag:github.com,2008:https://github.com/WeaselGames/godot_luaAPI/releases Release notes from godot_luaAPI 2024-01-24T18:48:08Z tag:github.com,2008:Repository/351998623/v2.1-beta11 2024-01-24T20:29:06Z v2.1-beta11 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.2.x</code></p> <h2>What's Changed</h2> <ul> <li><em><strong>BREAKING</strong></em>: <code>LuaAPI.do_file</code> and <code>LuaAPI.do_string</code> both had their return types changed from <code>LuaError</code> to <code>Variant</code>. This is to allow for return values.</li> <li><code>LuaAPI.do_file</code> and <code>LuaAPI.do_string</code> both now take an optimal second argument. Which would be an Array of arguments to pass to the script.</li> <li>Some minor documentation changes</li> </ul> <p>Example usage:</p> <div class="highlight highlight-source-gdscript notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="func _ready(): var lua: LuaAPI = LuaAPI.new() lua.bind_libraries([&quot;base&quot;, &quot;table&quot;, &quot;string&quot;]) var ret = lua.do_string(&quot;&quot;&quot; local a, b = ... print(a, b) return a + b &quot;&quot;&quot;, [4, 6]) if ret is LuaError: print(&quot;ERROR %d: %s&quot; % [ret.type, ret.message]) return print(ret) "><pre><span class="pl-k">func</span> <span class="pl-en">_ready</span>(): <span class="pl-k">var</span> <span class="pl-smi">lua</span>: <span class="pl-en">LuaAPI</span> <span class="pl-k">=</span> <span class="pl-en">LuaAPI</span>.<span class="pl-en">new</span>() <span class="pl-smi">lua</span>.<span class="pl-en">bind_libraries</span>([<span class="pl-s">"base"</span>, <span class="pl-s">"table"</span>, <span class="pl-s">"string"</span>]) <span class="pl-k">var</span> <span class="pl-smi">ret</span> <span class="pl-k">=</span> <span class="pl-smi">lua</span>.<span class="pl-en">do_string</span>(<span class="pl-s">"""</span> <span class="pl-s"> local a, b = ...</span> <span class="pl-s"> print(a, b)</span> <span class="pl-s"> return a + b</span> <span class="pl-s"> """</span>, [<span class="pl-c1">4</span>, <span class="pl-c1">6</span>]) <span class="pl-k">if</span> <span class="pl-smi">ret</span> <span class="pl-k">is</span> <span class="pl-en">LuaError</span>: <span class="pl-en">print</span>(<span class="pl-s">"ERROR <span class="pl-c1">%d</span>: <span class="pl-c1">%s</span>"</span> <span class="pl-k">%</span> [<span class="pl-smi">ret</span>.<span class="pl-smi">type</span>, <span class="pl-smi">ret</span>.<span class="pl-smi">message</span>]) <span class="pl-k">return</span> <span class="pl-en">print</span>(<span class="pl-smi">ret</span>) </pre></div> <p>Module MacOS actions started failing randomly so are sadly not included in this release.</p> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta10 2024-01-04T05:20:11Z v2.1-beta10 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.2.x</code></p> <h2>What's Changed</h2> <ul> <li>Minor in-engine documentation corrections by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sepTN/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sepTN">@sepTN</a></li> <li>Module builds updated to 4.2.1</li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta9 2023-12-01T03:31:20Z v2.1-beta9 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.2.x</code></p> <h2>What's Changed</h2> <ul> <li>Memory leak described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1888034099" data-permission-text="Title is private" data-url="https://github.com/WeaselGames/godot_luaAPI/issues/155" data-hovercard-type="issue" data-hovercard-url="/WeaselGames/godot_luaAPI/issues/155/hovercard" href="https://github.com/WeaselGames/godot_luaAPI/issues/155">#155</a> has been resolved now that GDExtension supports CallableCustoms. (Thanks to the amazing work done by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dsnopek/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dsnopek">@dsnopek</a> and other contributors in the <a href="https://github.com/godotengine/godot/pull/79005" data-hovercard-type="pull_request" data-hovercard-url="/godotengine/godot/pull/79005/hovercard">Godot Engine</a> and <a href="https://github.com/godotengine/godot-cpp/pull/1155" data-hovercard-type="pull_request" data-hovercard-url="/godotengine/godot-cpp/pull/1155/hovercard">godot-cpp</a>.)</li> <li><em><strong>BREAKING</strong></em>: Lua methods pulled as a Callable no longer take an array of arguments, arguments are passed 1 by 1 now. So instead of <code>myLuaFunc.call([arg1, arg2])</code> it is <code>myLuaFun.call(arg1, arg2)</code>.</li> </ul> <p>A special thanks to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Tekuzo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Tekuzo">@Tekuzo</a> as well, who helped upload the releases due to my internet being too slow currently.</p> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta8 2023-10-13T23:33:55Z v2.1-beta8 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <h2>What's Changed</h2> <ul> <li>Small bug fix for crashes related to when Lua loses reference of a RefCounted before godot.</li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta7 2023-10-11T16:45:18Z v2.1-beta7 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <h2>What's Changed</h2> <ul> <li>New LuaAPI field <code>LuaAPI.use_callables</code> when true, it will use the <code>LuaCallable</code> type which is a <code>CallableCustom</code> for lua methods like before. When false it will instead use the <code>LuaFunctionRef</code> type which is a <code>RefCounted</code>. It behaves the same but will use a <code>invoke</code> method rather then <code>call</code>. This resolves the issue of C# not supporting <code>CallableCustom</code> types. More details in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1933708390" data-permission-text="Title is private" data-url="https://github.com/WeaselGames/godot_luaAPI/issues/172" data-hovercard-type="pull_request" data-hovercard-url="/WeaselGames/godot_luaAPI/pull/172/hovercard" href="https://github.com/WeaselGames/godot_luaAPI/pull/172">#172</a></li> <li>Module releases are now using Godot v4.1.2-stable</li> <li>Memory leak described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1888034099" data-permission-text="Title is private" data-url="https://github.com/WeaselGames/godot_luaAPI/issues/155" data-hovercard-type="issue" data-hovercard-url="/WeaselGames/godot_luaAPI/issues/155/hovercard" href="https://github.com/WeaselGames/godot_luaAPI/issues/155">#155</a> has been fixed for all module builds. And a work around now exists for GDExtension using <code>LuaFunctionRefs</code></li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta6 2023-10-05T15:52:59Z v2.1-beta6 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <h2>What's Changed</h2> <ul> <li>Added support for UTF8 strings</li> <li>Added support for the FFI library while using the luaJIT builds.</li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v1.2-beta1 2023-10-02T01:57:21Z v1.2-beta1 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>3.x</code></p> <h2>What's Changed</h2> <ul> <li>Added support for UTF8 strings</li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta5 2023-10-02T04:15:40Z v2.1-beta5 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <h2>What's Changed</h2> <ul> <li>New methods to access and modify registry values from @RadiantUwU</li> <li>Some demo bug fixes from <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/SilicDev/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/SilicDev">@SilicDev</a></li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta4 2023-07-20T12:11:43Z v2.1-beta4 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <h2>What's Changed</h2> <ul> <li>Fixed some return types to allow for mono glue generation.</li> <li>The LuaAPI class memory usage, and limit are now uint64's rather then just a signed int32.</li> <li><code>__index</code> and <code>__newindex</code> now do not force the String type as the index, as this could in theory be any type.</li> </ul> Trey2k tag:github.com,2008:Repository/351998623/v2.1-beta3 2023-07-13T16:38:14Z v2.1-beta3 <p><g-emoji class="g-emoji" alias="warning">⚠️</g-emoji> <strong>This release of LuaAPI is for godot version</strong> <code>4.1.x</code></p> <p>This is the first large feature update for LuaAPI v2.1</p> <h2>What's Changed</h2> <ul> <li>Added <code>memory_limit</code> property to the <strong>LuaAPI</strong> class. This allows to set the max allowed memory usage for the Lua state in bytes.</li> <li>Added <code>object_metatable</code> property to the <strong>LuaAPI</strong> class. This sets the default metatable for Objects which do not define a <code>lua_metatable</code> property.</li> <li>Removed <code>permissive</code> property from the <strong>LuaAPI</strong> class. This has been replaced with the <code>permissive</code> property on <strong>LuaDefaultObjectMetatable</strong> which occupies the <strong>LuaAPI</strong> <code>object_metatable</code> property by default.</li> <li>Added <code>get_memory_usage()</code> method to the <strong>LuaAPI</strong> class. This returns the current memory usage of the Lua state in bytes.</li> <li>Removed <code>expose_object_constructor()</code> from the <strong>LuaAPI</strong> class. This is no longer needed, you can push the obj.new method as a global using <code>LuaAPI.push_global()</code> for the same effect but with constructor argument support.</li> <li>New <strong>LuaObjectMetatable</strong> class. This is a interface class meant to be used to define metatables.</li> <li>New <strong>LuaDefaultObjectMetatable</strong> class. This is the type that <code>object_metatable</code> defaults to, it provides the same functionality with metatables and metamethods we had before this update. The <strong>LuaAPI</strong> permissive property has been moved to this class now. It will yield metamethod calls to the object if it defines them like before. Otherwise looks for the <code>lua_fields</code> method which is either a blacklist or a whitelist depending on <code>permissive</code>.</li> </ul> <p>There are a lot of changes with this update so I suspect there may be some regression, if you notice any please open an <a href="https://github.com/WeaselGames/godot_luaAPI/issues/new/choose">issue</a>.</p> Trey2k