News:

SimuTranslator
Make Simutrans speak your language.

Tweak simutrans.sh to pass arguments from Steam to Simutrans

Started by dannyman, October 28, 2022, 10:24:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dannyman

[repost from https://steamcommunity.com/app/434520/discussions/2/3461605794224294942/]

I like to play like this:
simutrans -fullscreen -autodpi

Really nice!

In Steam, under the Cog, you can add command line parameters, like:
-fullscreen -autodpi

These are not passed to Simutrans from Steam, but I figured it out, at least on Linux.

In steam/steam/steamapps/common/Simutrans there is a simutrans.sh -- this is what Steam calls!

Change from this:
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./lib/" ./simpreloader

To this:
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./lib/" ./simpreloader $@

That $@ takes the arguments passed from Steam and passes them to simpreloader, which passes them to simutrans.

I don't know who maintains the Steam stuff here and I can't find simutrans.sh on github, but perhaps someone wants to bring this upstream? Thanks!!

Yona-TYT

I think there is a screen settings option, but I'm not sure if it's what you're looking for.
Captura desde 2022-10-28 19-30-35.png

dannyman

Yup. I discovered this in the UI, which is GREAT, but I had to check it every time I launched the game manually. As a grumpy old Unix man, I was like, "this should be automatic," so I dug a little into the rabbit hole. ;)

This scaling feature is dynamite! The last time I wanted to play Simutrans, I wrote a script to drop the resolution on my desktop beforehand. The scaling feature reduces the friction to launching into Simutrans, and whoever implemented it: I love you!

Yona-TYT

Quote from: dannyman on October 29, 2022, 09:29:10 PMand whoever implemented it: I love you!
The person responsible for this, if I remember correctly, was @ceeac :P

Roboron

Thank you, I totally overlooked this when I introduced the .sh file. It should work now again.

Such .sh file will probably disappear in the next release, as we made some changes to the way we package Simutrans that will make it obsolete.