Page 1 of 1

Write to file in data stage

Posted: Mon Oct 07, 2019 4:21 pm
by moon69
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?

Re: Write to file in data stage

Posted: Tue Oct 08, 2019 12:42 pm
by eradicator
moon69 wrote: Mon Oct 07, 2019 4:21 pm Has any change occurred in this regard?
Nope.

Re: Write to file in data stage

Posted: Tue Oct 08, 2019 3:55 pm
by BlueTemplar
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 !)

Re: Write to file in data stage

Posted: Tue Oct 08, 2019 4:51 pm
by darkfrei
BlueTemplar wrote: Tue Oct 08, 2019 3:55 pm 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 !)
Subject: Write to file in data stage

Re: Write to file in data stage

Posted: Tue Oct 08, 2019 5:33 pm
by BlueTemplar
Yes, can't you print to terminal (or is it stdout ?) while the game is starting up ?

Re: Write to file in data stage

Posted: Fri Jun 26, 2020 1:49 am
by Adamo
BlueTemplar wrote: Tue Oct 08, 2019 5:33 pm Yes, can't you print to terminal (or is it stdout ?) while the game is starting up ?
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).

I am disappointed to find out the only write_file routine, game.write_file(), is only available in the control phase.