Magic Duels: how to handle card LOL files
Posted: 03 Feb 2017, 22:26
-- How to handle card LOL files --
Introduction:
As you may be already aware, starting from the Aether Revolt expansion, Magic Duels' cards are structured as compiled Lua modules (with LOL extension). The structure has been observed and the card is described as a Lua table: no big difference from the change in the card pools... However, as of now, it seems that Magic Duels only accepts compiled cards (unlike the card pools which can be kept plain). Also, it seems impossible to override official cards just by making a new copy with the same name.
How to compile and decompile - automated procedure
Through batch files and Lua scripts I managed to make the procedure really fast and easy!
What you need:
Note: it appears that the compiled files we get through Lua contain the full path of the original file. If you are really picky and you want to save some bytes, put the original files in the Lua folder and compile them from there. This way the compiled file will contain the original file name, but no path.
Introduction:
As you may be already aware, starting from the Aether Revolt expansion, Magic Duels' cards are structured as compiled Lua modules (with LOL extension). The structure has been observed and the card is described as a Lua table: no big difference from the change in the card pools... However, as of now, it seems that Magic Duels only accepts compiled cards (unlike the card pools which can be kept plain). Also, it seems impossible to override official cards just by making a new copy with the same name.
How to compile and decompile - automated procedure
Through batch files and Lua scripts I managed to make the procedure really fast and easy!
What you need:
- A 32-bit version of Lua 5.1.x. You can download it immediately from this SourceForge link, then extract it in a folder of your choice.
- This ZIP file: which needs to be extracted in the same folder where you extracted Lua.
- Drag and drop a plain card file (with the new structure) onto Compile.bat, and you'll obtain the compiled version (with LOL extension) in the same folder.
- Drag and drop a compiled LOL file onto Decompile.bat, and you'll obtain the plain version (with LUA extension) in the same folder.
- If you need to compile/decompile entire folders, you can drop a folder onto BatchCompile.bat/BatchDecompile.bat. All the files in the folder will be processed by the compile/decompile script and the output will be placed in a subfolder called "compiled"/"decompiled" inside the Lua folder.
- How to compile - manual procedure | Open
Note: it appears that the compiled files we get through Lua contain the full path of the original file. If you are really picky and you want to save some bytes, put the original files in the Lua folder and compile them from there. This way the compiled file will contain the original file name, but no path.