Nice work!
Unfortunately I haven't made much progress: the problem I have is that I can't find a C# library for Lua 5.1 that works with our .lol files: almost all of them are based upon Lua 5.2, and the one based upon 5.1 (SharpLua) gives an array out of bounds error when trying to open the .lol file.
By using the command prompt interpreter for Lua 5.1.5 I have no problems getting the real table, but in order to do so I have to change that byte inside the .lol file so that its header becomes like the official ones: a proper tool could do that automatically and then extract all the tables in batch mode. Also, the command prompt doesn't support UTF-8, so special characters aren't properly parsed.
My last resort will be to write a Lua program to run in the command prompt itself. I don't know how well Lua manages binary files, but loading the .lol file and changing the header byte on-the-fly before parsing it would be nice.
EDIT: This last idea seems to work nicely, I just have to decide which table dumper I want to use. There are those who do "pretty printing" so that the table is easily human-readable, but they also sort the keys in alphabetical order, and that's not ideal for our purposes.
------------------
EDIT 2: The Lua script did its job. I'm not sharing it yet because it's not really user-friendly, but I'm sharing the card tables I extracted!
- Code: Select all
http://www118.zippyshare.com/v/kKHNifHY/file.html
I used
this dumper in order to output the tables to file.
Update: Version 2 is up. The "interpreted" cards should be 100% compliant to the original compiled files now, and the code parts are easily readable. The card sets have been extracted as well (even if they are never needed, it's just for completion's sake).
Now that the structure is well known, an xml-to-lol converter would definitely be possible... but it would take some time.
------------------
EDIT 3: I forgot to add an answer to this:
Xander9009 wrote:Specifically, the beginning:
- Code: Select all
local l_0_0 = module
local l_0_1, l_0_2 = ...
l_0_2 = package
l_0_2 = l_0_2.seeall
l_0_0(l_0_1, l_0_2)
This can be condensed in just one line:
- Code: Select all
module(..., package.seeall)
It appears that it's a way to start modules in Lua (now deprecated, but still used for Lua 5.1 which is the version used in all DotP installments). The 3 dots represent an argument to be passed to the .lol file: it's a string which will be used as name for the module. Look at the last paragraph of
this page and it will be easy to understand.