Xonotic Forums
[SUGGESTION] Lua scripting for the game? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Suggestion Box (https://forums.xonotic.org/forumdisplay.php?fid=20)
+--- Thread: [SUGGESTION] Lua scripting for the game? (/showthread.php?tid=5790)



Lua scripting for the game? - darkhog - 09-05-2015

I think Xonotic could use that.

Advantages of Lua over QuakeC:

- Easier to learn and successfully utilize
- Very fast (especially with LuaJIT)
- It's easier to find Lua coder these days than QuakeC one (better known language)
- Fast iteration (possibility to adjust code as the game is running)

Of course, QuakeC should remain both for compatibility and for those who prefer to use it, but IMO Lua's advantages makes it worth offering as an alternative.


RE: Lua scripting for the game? - machine! - 09-05-2015

If it would be possible I think the game would support all languages for scripting, the problem is implementing this and staying compatible with QuakeC since no one will rewrite all the gamecode in X language. Also someone with the required knowledge of both the language implementation and engine would need to be motivated enough to pull it off. All of these are quite unlikely.

If I were you and really wanted it to happy I would investigate some kind of Lua-to-QuakeC compiler instead, it's sure lot of work and will not be trivial (since the docs are pretty sparse on QuakeC), but I'm sure it's possible.

Some resources:
http://www.gamers.org/dEngine/quake/spec/quake-spec34/qc-menu.htm
https://github.com/graphitemaster/gmqcc


RE: Lua scripting for the game? - TimePath - 09-05-2015

Not now, maybe later without the JIT. Going dynamic to static isn't really an option either, but might be possible if there's a statically typed lua dialect.