The Charnel House Trilogy

The Charnel House Trilogy

View Stats:
SilasMortimer Jul 3, 2015 @ 8:32am
If you're having trouble running this in Linux...

The fix for the problem was a lot simpler than I realized. Two quotation marks need to be removed from the problematic line.


SCRIPTPATH="$(dirname "$(readlink -f $0)")"


SCRIPTPATH=$(dirname "$(readlink -f $0)")

... and the game runs just fine. I figured I would edit this post for anyone else looking for a solution.

*edit again: An even better solution would be to replace the line with:

SCRIPTPATH=$(realpath "$(dirname "$0")")

Though for now, either will work.

Original post below:


I was having trouble getting the Linux port to run and found that there was a problem in the CHT script. For some reason (and I've only taken a quick glance at it), the variable SCRIPTPATH was not parsing the directory name "The Charnel House Trilogy" with either quotes or putting \ before the spaces. So a quick fix that worked for me is commenting out that line and adding a replacement, specifying the path myself. So mine looks like this:

#SCRIPTPATH="$(dirname "$(readlink -f $0)")" SCRIPTPATH="~/.local/share/Steam/SteamApps/common/The Charnel House Trilogy"

If your Steam files are in another path, make sure to change it to the way yours is set up. After this, it should run just fine.
Last edited by SilasMortimer; Oct 4, 2016 @ 4:43am
< >
Showing 1-15 of 30 comments
Zed-K Jul 19, 2015 @ 3:34pm 
Thanks a lot, I was having the same issue :)

My CHT file was located in "/home/[username]/.steam/steam/steamapps/common/The Charnel House Trilogy" (I'm running Xubuntu 15.04).
SilasMortimer Jul 20, 2015 @ 7:50am 
It might be the same place. I also have ~/.steam and it will go to the same spot, but it's a link to ~/.local/share/Steam.

And you're welcome! Glad I could help.
Kallestofeles Oct 6, 2015 @ 9:37am 
Hesus, holy-moses. Thanks for bringing that up...
I already sent messages to devs without noticing this thread and troubleshoot the matter for a few days.
Anyways, yeah, this fixes the linux issues. Thanks!

//silly me for missing this post... =(
SilasMortimer Oct 6, 2015 @ 10:15am 
You're welcome. I should also warn you that the mouse does a funky thing when you move it to the top to bring the panel down if you move the mouse too fast. It doesn't break the game, though. Just when you go to the panel for something, give it a moment before you move the mouse. You'll see what I mean.
flesk Oct 4, 2016 @ 2:38am 
I haven't tried it, but the original

SCRIPTPATH="$(dirname "$(readlink -f $0)")"

seems like it should work to me. Odd that it's not.

Do you have the same issue if you instead replace it with

SCRIPTPATH=$(realpath "$(dirname "$0")")

SilasMortimer Oct 4, 2016 @ 3:38am 
I actually JUST figured out what's wrong with the line that's there. A pair of double quotes need removing. This works:

SCRIPTPATH=$(dirname "$(readlink -f $0)")
Last edited by SilasMortimer; Oct 4, 2016 @ 3:38am
SilasMortimer Oct 4, 2016 @ 3:40am 
I think it's confusing which quotation mark goes with which in the default way.
flesk Oct 4, 2016 @ 3:54am 
How does that change anything though? The outer quotation marks do seem completely superfluous, but I guess I don't understand why it was failing in the first place. Actually, had the name of the launcher had spaces in it, it should have failed without enclosing $0 in quotation marks, but that shouldn't be an issue here, since the game launcher is called CHT (according to SteamDB[]).

That command is actually in the official AGS build on GitHub[], so it's worth figuring out what's failing here and why, since it might affect other games too.

EDIT: Oh, wait. If the script is launched from a different directory and the path to the script has spaces in it, that should actually fail without enclosing quotation marks around $0. I'm surprised that it's working just by removing the outer quotation marks though.

EDIT 2: Could you add a


right after that variable is initialized, launch the script from terminal in a different directory (which the Steam client would do) and see what the script path resolve to?
Last edited by flesk; Oct 4, 2016 @ 4:09am
SilasMortimer Oct 4, 2016 @ 4:06am 
I don't know, but I looked at another game that uses AGS and has a Linux port, The Cat Lady, and it has the line with the outer quotes and works just fine. BUT, their game directory is TheCatLady without spaces. I just checked and Richard and Alice also has no spaces in its directory name: RichardandAlice. But this game's directory name is "The Charnel House Trilogy" (I actually like that better) and I think for some reason the outer quotes maybe... cancel out the inner ones? I'm not sure.
SilasMortimer Oct 4, 2016 @ 4:16am 
Yeah, I just copied the directory "The Charnel House Trilogy" to TheCharnelHouseTrilogy and ran CHT with the original line and it works. AGS' script just doesn't like directory names with spaces in them.
flesk Oct 4, 2016 @ 4:17am 
Ok, I think the spaces, along with the wrongly places quotation marks is definitely what's causing this issue then. I don't think multiple quotation marks in itself should be an issue, since what $() does is it executes whatever's inside it in a subshell, so those things should be happening in different scopes, so to speak.

...but apparently it does make a difference on your system, since that change fixes it for you. Could it have to do with with your default shell? I'm using Bash.
flesk Oct 4, 2016 @ 4:18am 
Originally posted by SilasMortimer:
Yeah, I just copied the directory "The Charnel House Trilogy" to TheCharnelHouseTrilogy and ran CHT with the original line and it works. AGS' script just doesn't like directory names with spaces in them.

Did you find out what SCRIPTPATH resolves to?
Last edited by flesk; Oct 4, 2016 @ 4:18am
SilasMortimer Oct 4, 2016 @ 4:19am 
I use BASH, but the script has #!/bin/sh anyway and I *think* sh is now just a rename of BASH, rather than a subset like it once was.
SilasMortimer Oct 4, 2016 @ 4:22am 
Okay, I made a short script in its own directory with spaces in it like this:

#!/bin/sh SCRIPTPATH="$(dirname "$(readlink -f $0)")" echo $SCRIPTPATH

When I run the script, the result is:

/home/silas/test/test with space

As you can see, no quote marks there.
SilasMortimer Oct 4, 2016 @ 4:26am 
Hm. Echo also shows no quotes with the outer quote marks removed. I wonder if there's a difference in the *type* of data the env thinks it is. Like, maybe with the outer quote marks, it takes it as a straight text string, while when you remove the outer quote marks, it treats it like an actual file name.
< >
Showing 1-15 of 30 comments
Per page: 15 30 50