Basically what the title says. I needed a simple way to execute game logic via our game’s dialogues and thought creating an interpreter could be fun. It didn’t need to be performant so I just used GDScript for the parser, and the amount of features is small, e.g., there are function calls, but not functions.
A script in Gompl could look like this:
while x < 10 do // variables are initialised as 0 if used without prior assignment
some_func(x) // functions are defined in GDScript, not in Gompl
x = x + 1
end
if some_other_func("test") != 100 then
"success"
else
"fail"
end
// the last expression (either "success" or "fail" in this case)
// is returned by Gompl's eval() method
If this is interesting to some, here’s the code: