Page 1 of 1
Reading mod data and write into files (for modinfo.adune.nl)
Posted: 30 Oct 2008, 01:34
by TradeMark
Since everything is going to be lua scripted, eventually...
Could someone tell me how to dump all the data of mods settings into some files similar as the TDF format is, or even better: a PHP array format? Or could someone make it? i dont know a shit about lua scripting...
Trepan, or someone promised to do this like a year ago when i asked, but i havent heard anything about this after that day...
It would be best if i could run spring in command line, and add some parameter to tell spring to read the mod data, with a line like:
Code: Select all
spring.exe -m "BA65.sd7" -o "C:/modit/ba65/"
Then i could make more flexible online mod database where anyone could upload their mods, and i could just run that command, and voila!
Hmm, should this be in feature requests...?
Re: Reading mod data and write into files (for modinfo.adune.nl)
Posted: 30 Oct 2008, 01:51
by Peet
The advice of a lua nub:
Could you not read through the unitdef tables and save their contents in whatever format you wish?
Re: Reading mod data and write into files (for modinfo.adune.nl)
Posted: 30 Oct 2008, 06:34
by trepan
Code: Select all
r6154 | trepan | 2008-07-12 12:18:39 -0300 (Sat, 12 Jul 2008) | 9 lines
- added the lua2php.cpp script
- a decent test for the unitsync LuaParserAPI
- saves all "defs.lua"definitions to a php compatible file
- added the LuaTable::GetType() calls
(they return the lua.h type enums)
Re: Reading mod data and write into files (for modinfo.adune.nl)
Posted: 30 Oct 2008, 08:02
by MelTraX
In case you want a PHP solution, I wrote a Lua table parser the last days for the ladder. Of course it can't execute Lua, it just reads a static table (like ArchiveCacheV7.lua or ModOptions.lua).
Tell me if I missed a dependency function or if it doesn't work for any file you test.
Re: Reading mod data and write into files (for modinfo.adune.nl)
Posted: 30 Oct 2008, 11:14
by TradeMark
trepan wrote:Code: Select all
r6154 | trepan | 2008-07-12 12:18:39 -0300 (Sat, 12 Jul 2008) | 9 lines
- added the lua2php.cpp script
- a decent test for the unitsync LuaParserAPI
- saves all "defs.lua"definitions to a php compatible file
- added the LuaTable::GetType() calls
(they return the lua.h type enums)
oh nice!
Now, could someone compile that for windows?
Does it support the commandline thing i suggested? If not, i dont have any real use for it...
MelTraX wrote:In case you want a PHP solution, I wrote a Lua table parser the last days for the ladder. Of course it can't execute Lua, it just reads a static table (like ArchiveCacheV7.lua or ModOptions.lua).
Tell me if I missed a dependency function or if it doesn't work for any file you test.
Cool, I'll try that later with lua maps, might be only usage for that, since nobody hasnt (yet) made any stupid programming in them.
Re: Reading mod data and write into files (for modinfo.adune.nl)
Posted: 31 Oct 2008, 16:52
by AF
At one point i worked on a json exporter program based on something trepan wrote