Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
11 stars 6 forks source link

[Bug] [Experimental] print/stdout is empty #527

Open Thomasims opened 3 months ago

Thomasims commented 3 months ago

Describe the bug

The game's stdout stream is no longer receiving any text (neither the usual game logs nor any print() call).

Modders never "officially" had access to this but it was easy enough to open a console; Either using a DLL to simply call AllocConsole() on Windows or simply running the game from a shell on Linux.

For many modders, particularly scripters, being able to output text to a (copy-able!) console is invaluable and suffice to say not having access to it anymore is a major setback.

This is also where level load times were written, a very useful data point for map-makers looking to cut down loading screen time. (I do note that this info is still available in log.txt, but it remains more convenient to have it on stdout.)

Steps to reproduce the behavior

  1. Create a mod which makes use of print() calls for debugging/iteration.
  2. Open a console window for the game
  3. Run the game & the mod
  4. Observe that the console remains empty

Expected behavior

At the very least for print() calls to pass through to stdout, as well as level load times (the "Loaded in x seconds" messages).

Environment

Additional context

No response

Gregory-Gregory commented 3 months ago

@Thomasims hi,

Thank you for this bug report.

I have gathered all the information and forwarded it to the QA team. If they need any additional details, I will let you know.

YuLun-bili commented 3 months ago

Or we can have a shortcut to bring out the in-game log window anytime anywhere.

Currently it's not easily accessible (editor -> log or F3 profiler -> log; former need to be in editor (obviously) while latter not available in UI such as options menu for global mods)

dannyTuxedoLabs commented 2 months ago

Hi there!

Got some information regarding this issue.

After calling AllocConsole(), you need to add freopen("CONOUT$", "wt", stdout) on the next line to redirect the output stream. Like this:

AllocConsole(); freopen("CONOUT$", "wt", stdout);

Thomasims commented 2 months ago

I understand that's the "fix" for the DLL but I still wonder why it's necessary at all; why was this changed in the experimental branch? Does it break the new in-game log window?