Any way to use Lua in the editor?

I mean, i am expert in Lua, but a beginner in Javascript, so here are 3 questions:

can i use Lua in the editor(normally)?
can i try using Lua in the editor(lua to javascript.js)?
is javascript easy to learn after lua?

I can only answer the third question, yes javascript is easy to learn, (specially if you will only use its array interaction part, and gdevelop events: gdjs | GDevelop JavaScript game engine )

Lua wouldn’t be really really impractical as the main scripting method for your game:

  • JavaScript’s already not intended to be a primary scripting method for the engine, only the event system is, and thus many GDevelop features will not work correctly when using them exclusively, and the API is often not very user-friendly.
  • You would need to load a Lua VM compiled to WASM to run the Lua code, which requires a somewhat high level of competence in JS, web tooling and GDevelop
  • You would need to create a JS function to expose to the lua VM as a lua function for every GDevelop JS API you want to call, which would be tedious and take a lot of time
  • The editing experience would be not great, because you’d probably have to script in an external editor with 0 autocomplete for any APIs, and copy paste the code into the GDevelop variable editor every time you make a change
  • You would not be able to use hot reloading, you’d have to fully close and restart the game on any change to the lua code
  • The whole thing would be an unstable mess that would probably need tweaking all the time to work correctly and take you much more time away than you would gain using a familiar language

As of now with GDevelop’s current capabilities, it is technically possible but it would be a terrible experience and you’d be much better off just giving visual scripting a try

1 Like