Export data from GameScript

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
barbagus
Engineer
Engineer
Posts: 3
Joined: 13 Jul 2023 17:49

Export data from GameScript

Post by barbagus »

Hi,

I am looking for a way to export some data aggregated using GameScript for external analysis. In order to do so, I wish I could export the content of the AI/SG debug window or, even better, directly write to filesystem from GS. Any information welcome !
barbagus
Engineer
Engineer
Posts: 3
Joined: 13 Jul 2023 17:49

Re: Export data from GameScript

Post by barbagus »

From IRC: apparently not possible for GScript to write to filesystem, copy/paste the AI/GS debug neither.
However, running with `-dscript=4` will dump the AI/GS debug to standard output
User avatar
jfs
Tycoon
Tycoon
Posts: 1764
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Export data from GameScript

Post by jfs »

I think the currently only supported method would be the Admin Port feature. That requires a special client, and only works in multiplayer games.
barbagus
Engineer
Engineer
Posts: 3
Joined: 13 Jul 2023 17:49

Re: Export data from GameScript

Post by barbagus »

Eventually I used the `-dscript=4 -l 127.0.0.1:<port>` along with a (python) script listening to that port and filtering output to show only my GScript output. Works great :D
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Export data from GameScript

Post by krinn »

openttd -d script=5 2>&1 | tee /var/tmp/ttdlog.txt
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 19 guests