Back to the main site

How to personnalize start script of a game with Lutris?


#1

Hello,

Syberia is a buggy game, on Windows and with wine.
When you launch it, you have a black window that appears in front of the main game window.
There are several workarounds: launch wine-config or taskmanager, then close them and the aim game window obtain the focus.
Or you can use nircmd.exe in a script to give focus to the main window game (look at winehq: https://appdb.winehq.org/objectManager.php?sClass=version&iId=19734&iTestingId=100474).

This the nircmd.exe script to use with wine:

wine Syberia.exe &
sleep  3.5
wine nircmd.exe win hide title Syberia
sleep 0.1
wine nircmd.exe win hideshow title Syberia

For PlayOnLinux, I could personalize the launcher script localised in “shortcuts” folder.

How can I integrate this script with Lutris?

Thank you for your help.


#2

I think you could make the game have a bash script as its executable and have the bash script execute those 5 lines you just wrote.

For example, the Warframe workaround uses about 400 lines of code to set the environment and directly calls Wine on line 403.

If I’m not mistaken, the trick used by GloriousEggroll was to create a .exe file which only had like “execute launcher.sh” as its instruction. Then, launcher.sh proceeds to do things ‘the linux way’.

If you want more inspiration to make all this work to create a Lutris install script, you can check Lutris’ Warframe script, which calls for Eggroll’s repository to download and execute these auxiliary files.


#3

Thank you for this info, I will get a look. Meanwhile I wrote this dos batch script:

    start game.exe
    ping 127.0.0.1 -n 3 > nul
    start nircmd.exe win hide title Syberia
    ping 127.0.0.1 -n 1 > nul
    start nircmd.exe win hideshow title Syberia

You have ti put nircmd.exe and this bat file in the aim Syberia folder.
Then ask Lutris to launch directly the bat file.
It works very well.
But if you launch the game in desktop mode (Wine Window), you have a 800x600 window resolution only.
So you can use DxWnd to play this game in fullscreen mode: copy the dxwnd folder in your wineprefix and change the Dos bat script like this:

cd c:\dxwnd
start dxwnd.exe /r:0
cd "c:\GOG Games\Syberia"
ping 127.0.0.1 -n 3 > nul
start nircmd.exe win hide title Syberia
ping 127.0.0.1 -n 1 > nul
start nircmd.exe win hideshow title Syberia

I use “ping” command instead of waitfor or sleep because this dos commands are not supported by wine.
the “/r:0” option for dxwnd progam is necessary to start dxwnd discretly, it doesn’t launch the program interface but directly the game. A Syberia profil have to be created before using this option.

sources:
nircmd.exe: http://www.nirsoft.net/utils/nircmd.html
dxwnd: https://sourceforge.net/projects/dxwnd/