<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MoTrix</title>
    <description>The latest articles on DEV Community by MoTrix (@mo-tx).</description>
    <link>https://dev.to/mo-tx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1730339%2F662b50b2-04a2-46f8-b95c-9c55705a8e66.png</url>
      <title>DEV Community: MoTrix</title>
      <link>https://dev.to/mo-tx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mo-tx"/>
    <language>en</language>
    <item>
      <title>GDXMS2: A MiniScript 2 API For Godot 4!</title>
      <dc:creator>MoTrix</dc:creator>
      <pubDate>Sat, 15 Aug 2026 13:09:36 +0000</pubDate>
      <link>https://dev.to/mo-tx/gdxms2-a-miniscript-2-api-for-godot-4-497g</link>
      <guid>https://dev.to/mo-tx/gdxms2-a-miniscript-2-api-for-godot-4-497g</guid>
      <description>&lt;h3&gt;
  
  
  Have you ever wanted to submit a MiniScript entry for the Micro Jam while still staying on your favourite game engine, have an easy to use alternative to Lua for modding your games or just have a lightweight yet fast embedded interpreter in your Godot project? Then &lt;strong&gt;this&lt;/strong&gt; is what you're looking for!
&lt;/h3&gt;




&lt;p&gt;Godot-X-MiniScript2 (AKA GDXMS2) is a set of bindings that integrate both the C++ and C# versions of the new MiniScript2 interpreter inside Godot 4's ecosystem—respectively using GDExtension(godot-cpp) and GodotSharp(Godot Mono).&lt;/p&gt;

&lt;h2&gt;
  
  
  Status:
&lt;/h2&gt;

&lt;p&gt;This project is currently in its very early stages, albeit usable if you build the latest commit or use the latest release.&lt;/p&gt;

&lt;h2&gt;
  
  
  Description:
&lt;/h2&gt;

&lt;p&gt;This project implements has 2 implementations in C++ and C# for wrapping MiniScript inside Godot4 specifically GDScript for quick iteration, particularly for the Micro Jam game jam in order to make MiniScript entries using Godot.&lt;br&gt;
Currently the C# implementation is not done. But the C++ one has working basics which includes an Interpreter class with the methods create(source_code: string) (creates an interpreter instance, .new() not recommended), reset(source_code: string) to change its source code, compile() to compile the source code and run_until_done(time_limit: float, return_early: bool) to run the compiled code. More features are planned to be added and are WIP.&lt;br&gt;
Check out the &lt;a href="https://github.com/Mo-Tx/Godot-X-MiniScript2/" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage (in GDScript): an iterative factorial example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="c1"&gt;##example node script using the "Interpreter" class&lt;/span&gt;
&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt;

&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;test_number&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_ready&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  
    &lt;span class="c1"&gt;#Init all global MiniScript components(GC, constants, error types, ...) and set the stdout and stderr&lt;/span&gt;
    &lt;span class="c1"&gt;#In this case, they are the default godot stdout(print and push_error); but any method that takes a string will work&lt;/span&gt;
    &lt;span class="n"&gt;Interpreter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;init_miniscript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;push_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;#create an interpreter object with its initial code set to the desired source code(to avoid resetting the interpreter after creation)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;interp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Interpreter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="c1"&gt;#here we forcibly injected the variable in the source code since we don't have an I/O or value sharing API yet&lt;/span&gt;
    &lt;span class="s2"&gt;"test_number="&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test_number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;
    &lt;span class="s2"&gt;"""
    factorial=function(x)
        if x==0 or x==1 or x==null then return 1
        mult=1
        for i in range(x, 2)
            mult*=i
        end for
        return mult
    end function
    print factorial(test_number)
    """&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;#compile the interpreter's source code&lt;/span&gt;
    &lt;span class="n"&gt;interp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="c1"&gt;#run it with a 2-second time limit and with early returns (read MiniScript docs for more details)&lt;/span&gt;
    &lt;span class="n"&gt;interp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run_until_done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>miniscript</category>
      <category>godot</category>
      <category>gamedev</category>
      <category>api</category>
    </item>
  </channel>
</rss>
