Author Topic: Other Linux Surprises (crashing, that is)  (Read 1298 times)

Offline Otherlander

  • Green Pilot
  • *
  • Posts: 12
    • View Profile
Other Linux Surprises (crashing, that is)
« on: January 29, 2011, 09:09:32 am »
This is not the first time I've encountered this peculiar occurrence with games one doesn't install in Linux, but it goes like this:

When I run gearhead_2d from within its folder (essentially, navigating there in a window browser and opening it up with a doubleclick), everything is fine and dandy. I take the exact, correct, command for gearhead_2d and put it in the menu. When I try to run from there, gearhead_2d makes a show nearly identical to the one put on by gearhead in the previous instance, and then crashes to desktop.

The "show" is a bunch of black window distortions and resolution changes that resolve back to the desktop.

Any idea how I can fix that? I loathe running things that leave evidence in their wake (open folders, dedicated terminal windows, that sort of thing), plus navigating to the folder is much slower than the menu.

Offline Joseph Hewitt

  • Administrator
  • Ace
  • *****
  • Posts: 2594
    • View Profile
    • http://www.gearheadrpg.com
Re: Other Linux Surprises (crashing, that is)
« Reply #1 on: January 29, 2011, 09:30:16 am »
Sounds like the problem is that it can't find the data directories. No idea off hand how to fix the problem, but that's probably what the problem is.

Offline magic.coding.fairy.peridot

  • Veteran
  • ***
  • Posts: 197
    • View Profile
Re: Other Linux Surprises (crashing, that is)
« Reply #2 on: January 29, 2011, 11:40:27 am »
I'm just guessing here (I use Linux but I'm an old-school terminal type of girl so I haven't seen this exact misbehaviour) but I think what's probably happening is that gearhead is finding its data files based on your current directory when you run it. To check whether this is really what's wrong, open a terminal (yes, by the end of the message I'll propose a terminal-free solution - once you're sure you know what the problem is). If gearhead is in the directory /home/me/gearhead, you should be able to run it two different ways: run "cd" (to switch to your home directory) and then "/home/me/gearhead/gearhead_2d" (or whatever the executable is called); or you can "cd /home/me/gearhead" and then just "./gearhead_2d". If I'm right, the former will fail, the way your menu entry does, and the latter will succeed. If this is what you see, then you can get a nice menu entry by doing the following:

Create a text file (with, say, gedit) called "run-gearhead.sh". In it, put two lines: "cd /home/me/gearhead" and "./gearhead_2d". Now right-click on the text file in your file manager, go to "properties", and set it to executable. Now double-clicking on this file should run gearhead, but putting it in your menu should also work (unlike putting gearhead in your menu directly).

Offline eliddell

  • Green Pilot
  • *
  • Posts: 11
    • View Profile
Re: Other Linux Surprises (crashing, that is)
« Reply #3 on: January 29, 2011, 05:15:52 pm »
The ASCII version works correctly for me launching from a desktop icon with the working directory explicitly set (and fails when I try to launch it from outside the directory), so the problem almost certainly is indeed wrong working directory/can't find the data files. 

There should be something that allows you to edit the properties of your menu entry (try right-clicking)--look in there for something that says "Working Directory" or "Work Path" or the like.

Offline Rowanthepreacher

  • Veteran
  • ***
  • Posts: 103
  • [url]http://www.hunglikeanorca.com[/url]
    • View Profile
Re: Other Linux Surprises (crashing, that is)
« Reply #4 on: January 30, 2011, 07:05:39 am »
Uhh. That's weird.

Gearhead 2 ASCII version brings up a terminal anyway, doesn't it? It does for me.... so it it's doing the same things when you double click on the GUI symbol as it would be if you just ran it from shell.
I'm not actually a spammer. I promise.

Offline Otherlander

  • Green Pilot
  • *
  • Posts: 12
    • View Profile
Re: Other Linux Surprises (crashing, that is)
« Reply #5 on: January 30, 2011, 08:26:48 am »
@Peridot: You're right on the money. That being said, you needn't have been trying to spare me the horrors of the terminal (I like the gedit touch, but I prefer nano unless I'm coding, in which case I need the syntax highlighting). (Begin ranting and rambling)

I like the terminal myself. Hell, I've even manually adjusted the cursor width in firefox so that it is the old-style block (and enforced a text styling so that there's never a situation where the block is off-size). I just hate leaving /spare/ terminal clutter, for instance, the only way to run UZBL is from a terminal, from what I've been able to tell (the same solution won't apply here, because UZBL can be run from any directory), which leaves a terminal window lying around waiting for UZBL to die in a blazing fire caused by pulseaudio. So I installed Guake, mainly so I can pack the terminal out of the way (Guake, incidentally, will show up and be responsive faster than calling up a new terminal window, if you're interested, it also has a twin program that is. . . less intuitive (read: crashes on start-up even fresh out of the repository) called Tilda).

Fortunately for you, I've made bash scripts before, so I got the thing done right the first time.