Page 1 of 1
Lua output gripe (windows)
Posted: Wed Aug 05, 2015 7:46 am
by Flux Faraday
Before v12, Factorio's lua output didn't appear (in windows) unless you redirected Factorio's stdout from the command line (see this post
https://forums.factorio.com/forum/vie ... =25&t=8661 ). Now, Lua's output appears unconditionally, but isn't going through stdout (or stderr), so I'm unable to redirect it to a file. That makes it harder to debug, because the interesting part of the lua output has usually scrolled off the top of Windows' CMD window. It would be nice if this could, once again, be output in a way that it can be redirected and analyzed. Or, if it can be redirected, please let me know how. [edit:] Maybe all of this is going to go into a log file someday. That would work too.
Thanks!!
Re: Lua output gripe (windows)
Posted: Wed Aug 05, 2015 6:56 pm
by Adil
What? The only output I'm getting on linux is the ingame console and a couple log files in root directory of the game.
Re: Lua output gripe (windows)
Posted: Wed Aug 05, 2015 9:44 pm
by Flux Faraday
In addition to lua output, it is printing some timestamped status. Like this:
Code: Select all
C:\Users\whn\Desktop\Gamestuff\Factorio_0.12.1\bin\x64>Factorio.exe
C:\Users\whn\Desktop\Gamestuff\Factorio_0.12.1\bin\x64> 0.000 Info Main.cpp:1
50: Program arguments: "0,000,005,E6D,DFC,8B0"
0.001 2015-08-05 14:22:56; Factorio 0.12.1 (Build 16116, win64)
0.001 Operating system: Windows 8.1
0.001 Read data path: C:/Users/whn/Desktop/Gamestuff/Factorio_0.12.1/data
0.001 Write data path: C:/Users/whn/Desktop/Gamestuff/Factorio_0.12.1
0.001 Binaries path: C:/Users/whn/Desktop/Gamestuff/Factorio_0.12.1/bin
0.003 Info LocaleProvider.cpp:282: Language en is LTR
0.003 Info LocaleProvider.cpp:282: Language en is LTR
0.065 Initialised Direct3D: NVIDIA GeForce GTX 970; driver: nvd3dumx.dll 10.1
8.13.5362
0.125 Graphics options: [FullScreen: true] [VSync: true] [UIScale: 100%] [Mul
tiSampling: OFF] [Graphics quality: normal] [Video memory usage: all]
0.231 Loading mod core 0.0.0 (data.lua)
0.236 Loading mod base 0.12.1 (data.lua)
0.679 Info LocaleProvider.cpp:282: Language en is LTR
0.679 Info LocaleProvider.cpp:282: Language en is LTR
0.682 Info LocaleProvider.cpp:282: Language en is LTR
0.682 Info LocaleProvider.cpp:282: Language en is LTR
0.766 Initial atlas bitmap size is 16384
0.768 Created atlas bitmap 16384x7656
8.943 Factorio initialised
14.741 Goodbye
Notice the second command prompt? It looks like Factorio is putting itself in background somehow (and probably dropping the file descriptors it starts with). Version 11 stayed in the foreground.
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 5:01 am
by Adil
Well, to me it looks exactly like factorio-current.log from the factorio folder. If it doesn't appear on windows, I'd report a bug.
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 5:26 am
by Flux Faraday
factorio-current.log does appear in Windows, but has no lua output in it. That would be a great place for the output to go!
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 5:35 am
by Adil
Which lua output you're talking again?
I've never seen game.player.print() put anything anywhere apart from ingame console. And log files only ever received error messages from prior initialization or crashes.
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 6:59 am
by Flux Faraday
I'm talking about the output from the lua built-in function called "print". Most of my modding changes happen at "data.lua" time, so the "game.player.print" function doesn't exist yet. Even if it did, it prints to the screen in-game, so it would not be useful for tracking down an algorithmic error, or printing the contents of a bunch of tables for study.
Like this:
----data.lua----
print(data.raw.recipe["speed-module"].energy_required)
------------------
...would print the time to produce a speed module.
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 7:46 am
by Adil
Ah, that's why it doesn't error on /c print(' ')
It works on linux. Both print() from data and console cause text to appear in terminal. And if I launch factorio with redirecting to file (./factorio >> file.txt) I do get the file with all the output.
You really should contact devs about it.
Another silly advice would be try powershell instead of cmd. (It's more of normal terminal, yes?)
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 9:45 am
by Flux Faraday
Adil wrote:
Another silly advice would be try powershell instead of cmd. (It's more of normal terminal, yes?)
That's a great suggestion. I'll try it in the morning, and file a bug report if I still can't capture my output.
(Maybe instead of PowerShell I should just play it on Linux

I miss bash. )
Thanks!
Re: Lua output gripe (windows)
Posted: Thu Aug 06, 2015 5:52 pm
by Flux Faraday
Powershell helps (a lot) because it has a much larger scroll area than cmd does. But since I still cannot capture the output, I'll file a bug report. Thanks!