API call to write to the game log file
Moderator: ickputzdirwech
API call to write to the game log file
The original idea here was a way to get data out of the game to another process. Someone on IRC suggested alerting IRC or twitch when a rocket is launched. It occurred to me that one way to do that, which would also be generally useful, would be to just be able to write a line out to the game log file.
Re: API call to write to the game log file
Hello,
you can write what you want to any file you want in script-output directory with game.write_file().
Also there is a rocket launched event - https://wiki.factorio.com/index.php?tit ... t_launched.
Now it's up to you to out them both together
Greetings steinio
you can write what you want to any file you want in script-output directory with game.write_file().
Also there is a rocket launched event - https://wiki.factorio.com/index.php?tit ... t_launched.
Now it's up to you to out them both together
Greetings steinio
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: API call to write to the game log file
don't forget you also have access to log(debug.traceback())
not sure if that's specific to data code, or if it works with other things like scripting too.
not sure if that's specific to data code, or if it works with other things like scripting too.
Re: API call to write to the game log file
log() works anywhere and writes out to the game log file.bobingabout wrote:don't forget you also have access to log(debug.traceback())
not sure if that's specific to data code, or if it works with other things like scripting too.
If you want to get ahold of me I'm almost always on Discord.
Re: API call to write to the game log file
AH. Good, I wasn't sure. Now I can move it to implemented.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...