protonscr

Using %command% to launch Source Mods stops at /bin/sh: -g: invalid option

steamopen reviewed
ValveSoftware/steam-for-linux#4224 · opened 2016-01-01 by truboxl · updated 2016-04-29 · 4 comments · github
Ttruboxl 2016-01-01 github

Fedora 23 MATE

*1. After I put the mods in the the respective folder and followed the instruction installing the engine,
it fails to launch.

Looking at the terminal gives this...

Game update: AppID 243750 "Source SDK Base 2013 Multiplayer", ProcID 2477, IP 0.0.0.0:0
ERROR: ld.so: object '/home/USER/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
/bin/sh: -g: invalid option
Usage: /bin/sh [GNU long option] [option] ...
/bin/sh [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--rcfile
--rpm-requires
--restricted
--verbose
--version
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
CAPIJobRequestUserStats - Server response failed 2
Game removed: AppID 243750 "Source SDK Base 2013 Multiplayer", ProcID 2477

Game: Team Fortress 2 Classic
Engine: Source SDK Base 2013 Multiplayer

*2. Ok so force start through terminal instead of Steam able to launch the game with my custom launch option below...

primusrun '~/.steam/root/steamapps/common/Source SDK Base 2013 Multiplayer/hl2.sh' -steam -game '/home/USER/.steam/root/steamapps/sourcemods/tf2classic'

Somehow the (hl2.sh?) script doesn't recognise ~/.steam/root/steamapps/sourcemods/tf2classic
and
I had to specifically replace ~/.steam/... with /home/USER/.steam/...

EDIT: Thanks danielkza, now it works. Second problem cleared.

primusrun '~/.steam/root/steamapps/common/Source SDK Base 2013 Multiplayer/hl2.sh' -steam -game ~/.steam/root/steamapps/sourcemods/tf2classic

For the 1st problem, I don't really know who is at fault right now... Distro? Steam? Game?

Ddanielkza 2016-01-01 github

The shell is the one that expands the tilde, and placing it inside a quoted string will disable that. Remove the quotes around the path and it will work.

Ttruboxl 2016-01-01 github

Hey thanks! It worked... So that's one issue down.
Now onto the Steam Launcher thing problem.

Ttruboxl 2016-01-04 github

Ok so today I cleared everything in the Launch Options in Steam for that Source Mod
and
IT WORKS! The game loads successfully.

However,
it will load the game using Intel GPU and that somewhat impacts the performance...

According to https://support.steampowered.com/kb_article.php?ref=6316-GJKC-7437
I can use

primusrun %command%

to allow games to switch using NVIDIA GPU.

True, but it seems it will not work with mods I think as it stops at /bin/sh: -g: invalid option

After deeper digging, the true problem lies with entering this in the Launch Options

%command%

This line actually triggers the error...

So, how am I going to use the trick suggested at Steam Support to run the mod with NVIDIA GPU?

Ttruboxl 2016-01-08 github

Ok I found the workaround to have the mod use NVIDIA GPU + Steam Overlay...

I have to manually set the path to the mod for Source SDK Base 2013 Launch Option and launch it from there...

primusrun %command% -steam -game ~/.steam/root/steamapps/sourcemods/tf2classic

Note: I know that the %command% already includes -steam parameter added.
However the SDK Base seems to ignore it for the mod and VAC issues occured.
Please refer ValveSoftware/source-sdk-2013#364

NVIDIA GPU, Steam Overlay and almost everything worked
except that
your friends are seeing you playing Source SDK Base 2013 Multiplayer (and your playtime as that too) instead of the mod

Launch lines