wysiwyg wrote:@mad_joker - what tools are you using to recompile the lua code? I've successfully decompiled the .xpl files with Night Nords's excellent python lua tool. I was just interested in what you recommend as a compiler. I'm fairly new to lua so still getting my head around it. Looking forward to seeing some of your work under the hood and in practice when it's ready.
I am using LuaJIT for compiling. The official site doesn't have a pre-compiled version though, so you'll have to compile one yourself (the site has instructions how to do this).
In my modding guide I plan to add a suite of tools as well, which will contain all of the compiler stuff as well as an exe to compile and pack your mod (there are some things you need to be careful of with that).
About Lua: I also never had used Lua before I started with this, but if you did any JavaScript, Lua is rather easy to get into. The only thing I noticed you should be aware of is that there is a colon and a dot operator in Lua, which both compile to the same byte code, which means during decompilation it will always be decompiled to the dot operator. The colon is practically identical to using dot and passing the calling object as the first argument. Below is an example:
Code: Select all
object.method(object, ...) == object:method(...)
This means you will for example often see code like
in the original code, which should rather be read as
which makes the code more readable imo.
Hafe vun modding!