Export Technologies

Calculate optimal ratios for feeding recipes, search through the research-tree, specialized tools to view game-information.
Post Reply
Colossus
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Mon Mar 10, 2014 8:31 pm
Contact:

Export Technologies

Post 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.

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Export Technologies

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Export Technologies

Post 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.

mlofinti
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Apr 29, 2016 1:17 pm
Contact:

Re: Export Technologies

Post 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))

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Export Technologies

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Post Reply

Return to “Cheatsheets / Calculators / Viewers”