Write to file in data stage

Place to get help with not working mods / modding interface.
Post Reply
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Write to file in data stage

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

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Write to file in data stage

Post by eradicator »

moon69 wrote:
Mon Oct 07, 2019 4:21 pm
Has any change occurred in this regard?
Nope.
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.

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Write to file in data stage

Post 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 !)
BobDiggity (mod-scenario-pack)

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Write to file in data stage

Post 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

User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 2420
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Write to file in data stage

Post by BlueTemplar »

Yes, can't you print to terminal (or is it stdout ?) while the game is starting up ?
BobDiggity (mod-scenario-pack)

Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

Re: Write to file in data stage

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

Post Reply

Return to “Modding help”