Page 1 of 1

Export Technologies

Posted: Mon Oct 12, 2015 3:11 pm
by Colossus
Does anyone know if there's a way to export a list of technologies along with cost/pre-reqs/allows using a script or something else? I'm interested in getting a list including all the additional technologies added by the mods I have installed, such as Bob's Mods.

Re: Export Technologies

Posted: Mon Oct 12, 2015 4:49 pm
by Adil
Yes there is. During loading of data files you have access to all the tables and iirc you can create files in the script output folder. (And you can always redirect the output of lua print command.)
The prettyness of this is entirely dependent on you though.

Re: Export Technologies

Posted: Mon Oct 12, 2015 5:35 pm
by orzelek
Adil wrote:Yes there is. During loading of data files you have access to all the tables and iirc you can create files in the script output folder. (And you can always redirect the output of lua print command.)
The prettyness of this is entirely dependent on you though.
I haven't found a good way to write to a file on loading stage. There is no direct file access available there since it's part of game object.

Re: Export Technologies

Posted: Sat Apr 30, 2016 6:54 pm
by mlofinti
It's hardly ideal, but any string you pass to "error" ends up in the log. (It also makes the game quit, and if you pass a large string it pauses for a long time first). I exported a copy of the data.raw with all of Bob's mods that way just today, making a dummy mod whose data-final-fixes.lua was just

Code: Select all

error(serpent.block(data.raw))

Re: Export Technologies

Posted: Mon May 02, 2016 2:00 pm
by Adil
Instead of error() ordinary print() may be used. It prints to stdout. Then the game output can be redirected to a file instead stdout.
Not really pretty, but yet not overly complicated for a one-time procedure.

Also, as far as knowing new stuff better is considered, I believe I've seen script generated production trees these days, might be worthwhile to first check relevant subforums and\or ask in communiies on internet for finished solutions.