I've found a few discussions about a write_file type function that's available in data stage, but most are old and end with "just use log()".
Has any change occurred in this regard?
I find it incredibly useful while debugging mods to look at the data.raw dump, but it makes the log file very large and unweildy.
Even something simple like a "spamlog()" command to write to a 2nd log file would be useful if an equivilent to write_file is too hard.
Any suggestions?
Write to file in data stage
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Write to file in data stage
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
- BlueTemplar
- Smart Inserter
- Posts: 2420
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Write to file in data stage
Not sure if useful (could help with some terminal tricks?), but there's also lua's print()... (not to be confused with game.print(), which writes to the in-game console !)
BobDiggity (mod-scenario-pack)
Re: Write to file in data stage
Subject: Write to file in data stageBlueTemplar wrote: ↑Tue Oct 08, 2019 3:55 pmNot sure if useful (could help with some terminal tricks?), but there's also lua's print()... (not to be confused with game.print(), which writes to the in-game console !)
- BlueTemplar
- Smart Inserter
- Posts: 2420
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: Write to file in data stage
Yes, can't you print to terminal (or is it stdout ?) while the game is starting up ?
BobDiggity (mod-scenario-pack)
Re: Write to file in data stage
I believe you are correct. print() prints to stdout, whereas log() prints to log (which also prints to stdout in the sense that the factorio logging is printed to stdout by default).BlueTemplar wrote: ↑Tue Oct 08, 2019 5:33 pmYes, can't you print to terminal (or is it stdout ?) while the game is starting up ?
I am disappointed to find out the only write_file routine, game.write_file(), is only available in the control phase.