Jump to content

GemRB Launcher


myownlittlworld

Recommended Posts

So, I really like GemRB, which is why I said to myself, "God, this project is great, but you know what would make it even better? If it had a launcher!" I thus took it upon myself to make a really really simple launcher for GemRB that sets up your config file, automatically mounts CD images, starts the program, and unmounts the CD images when you're finished.

 

What follows is an excerpt of the readme file of the initial release of the launcher that is available at:

people.hws.edu/Sword_Envy/gemrb/gemrb-launcher.tar.bz2

 

A simpler demo of this same feature that I made last year is available at:

people.hws.edu/Sword_Envy/gemrb/autorun.tar.bz2

 

README:

 

A GemRB launcher that handles everything automagically? Really? Yup.

 

Proof that my boss doesn't give me enough work every day, this is a GemRB

launcher that:

 

Sets up an appropriate config file (really, just copies an already existing one)

Mounts CD images

Starts the game

Unmounts CD images

 

To run it:

 

You'll need gksu (it's pretty standard, you should have it already).

You'll need pyGTK and Python.

You'll need to place these files in a subdirectory of the main GemRB folder (I

personally use gemrb/launchers).

 

Then, set the locations of your cd(-image)s in each of the launcher/start/*

files that you plan on using.

Copy your regular GemRB.cfg file to each of:

baldursgate1.cfg

baldursgate2.cfg

icewinddale1.cfg

icewinddale2.cfg

 

Then, in each cfg file, set up the correct directories for each mounted CD

image (look in launcher/start for help).

 

Open a console, and type:

./autorun-gemrb.py

 

Then, watch the console output and hope it works.

 

I tested it for Baldur's Gate 1, because it's what I had room for on my HD at

the time. It should work for all the rest of the games, but you might have to

modify the number of CDs used in the .cfg and the start.sh files (I don't

remember the count for each of the games exactly).

 

Hope you like it!

Link to comment

Very true... I just did that because I hate having extra folders lying around... But, rm -r as root is never a good idea, and I didn't even think of that.

 

This should be nicer, it puts /tmp to proper use and doesn't rm anything. In an ideal world, mounting and umounting (running any code as root, actually) could be avoided altogether. In a sense though, it already can, as the user could just copy the file-system of the discs to the hard-drive and avoid the start/stop scripts entirely, with no code run as root at all.

 

I tried to make it as easy to hack on as possible, and I hope that comes through in the result:

 

people.hws.edu/sword_envy/gemrb/gemrb-launcher.tar.bz2

Link to comment

:)

The start/stop scripts need to be more versatile. Some people don't have tob, some have dvd editions. Planescape torment is missing (and some addons). The addons could be taken care of automatically by some additional logic in the start/stop scripts - they could look in the config for the number of cds.

 

Once those are working perfectly, the discpoint could be set in the gemrb cfg, so the user doesn't need to modify any script.

 

From a packaging point of view it would be nice if the script didn't assume being in the correct path. Support for arbitrary path would be good too (lets say you have it installed system-wide). As would support for custom gemrb binary - now only the one in the current dir can be used.

Link to comment

Lynx, some of the issues you addressed have been fixed (see above for URL)... Well, one anyway.

 

If you specify the location of the config files (either relative to the autorun.py file, or with a full path) the launcher will read the appropriate config file and launch the gemrb binary specified in the file.

 

I couldn't do the same for the CDs, at least not without adding new options to the config file. The problem is that the options "CD1"-"CDX" are currently overloaded: I use them as mountpoints for my disc images, while other people are completely free to use them as folder copies of the cds (perhaps they're people who hate mounting/unmounting things).

 

To fix that problem, at least two options would need to be added to the config files: one that indicates whether or not we're using CD Images, and another that says where to mount them if we're using them.

 

If the people in charge would give their blessing to adding those config file options, then I could work on adding auto-detection of usable cds too.

Link to comment

Updated again, 5 changes in all:

people.hws.edu/Sword_Envy/gemrb/gemrb-launcher.tar.bz2

 

Biggest news, you can now add "CD#image=" options to the config file to show the launcher where the disc images you want to mount are located. As a bonus, it'll use fuse if possible.

 

  1. You can optionally specify the location of your config files as the first argument to the script (the command line argument overrides the default value in the script):
    ./autorun-gemrb.py (config_directory)


     
    If not, you'll have to specify the config directory in the script itself (which is overridden by the command line argument). The addition of the command line argument removes any requirement to edit the autorun-gemrb.py file directly, allowing it to be run from a read-only directory (/usr/bin/ comes to mind).
     

  2. The launcher now reads all the information it needs to run from the appropriate config file:
    • baldursgate1.cfg
    • baldursgate2.cfg
    • icewinddale1.cfg
    • icewinddale2.cfg
    • planescapetorment.cfg

 

[*]The start/stop scripts have been removed in favor of a less flexible yet smarter automatic (un)mounting system. If you use disc images and need to (un)mount them for playing GemRB, add an additional option in your config files:

 

CDXimage=

 

This config option will tell the launcher program where to find each CD image, which it will then mount at the point specified by "CDX=".

 

If you're a member of the "fuse" group and the required executables are found, the launcher will attempt to (un)mount the images using fuse, otherwise it'll attempt to gain root privileges to mount the images. Fuse is the suggested method for (un)mounting the disc images, not only does it not require root privileges, but it will mount a disc image in nearly any format, unlike mount, which only accepts .iso type images by default.

 

[*]If the required config file doesn't exist, the program now quits gracefully instead of hanging forever (bad if you weren't running in a console).

 

[*]Planescape: Torment has been added.

 

I think that's about all the outstanding issues with the thing... Other than giving it a decent background, of course; obviously I'll accept any background design that any better artist can give. Happily awaiting feedback on this version!

 

Lynx: I don't believe that fusermount can be used to mount images without adding entries into /etc/fstab, sort of defeating the "ease of use" I was hoping for. Fuseiso can mount, though you still need fusermount to unmount. Strange strange dependencies...

Link to comment

Release 0.0.0.6: "Revenge of the Meta-CD"

 

This release adds sexy "graphics" to the PlaneScape: Torment button, attempting to show enterprising artists what is possible (accepting all backgrounds and buttons!). More interestingly, however...

 

This release fixes a major bug in the mounting/unmounting process (a "game killer," let's call it): Correct handling of discs that contain other discs.

 

This only really concerns people using CD images, as people who have simply copied the disc's contents to a folder probably realized this ahead of time.

 

Short and sweet of it, if you have a CD that contains folders like "CD2", "CD5", etc., you need to add an option to your config file called "CDXmount=", and make the "CDX=" entries point to subdirectories of that folder. Otherwise, GemRB won't see the game data, it'll only see folders labeled "CD4" and such.

 

Using Baldur's Gate 1: Tales of the Sword Coast as an example, the full set of config entries would look something like:

 

GameData=/home/nick/wine/drive_c/baldursgate1

CD1image=/home/nick/bg_tos_1.iso
CD1=/tmp/bg1/disc1

CD2image=/home/nick/bg_tos_2.iso
CD2mount=/tmp/bg1/disc2
# note the fact that the CD variables are sub-directories of the mount location
CD2=/tmp/bg1/disc2/CD2
CD5=/tmp/bg1/disc2/CD5

CD3image=/home/nick/bg_tos_3.iso
CD3mount=/tmp/bg1/disc3
CD3=/tmp/bg1/disc3/CD3
CD4=/tmp/bg1/disc3/CD4
CD6=/tmp/bg1/disc3/CD6

 

If you set the GameData and the CD#image entries correctly, and leave the rest as it is, the game will run correctly (this is almost verbatim what I have in my own baldursgate1.cfg). Just keep in mind the fact that each CD is a set of CDs, and GemRB needs to read each individual CD, not the whole set... Also, blame BioWare for concocting such a ridiculous scheme to save 15 cents per copy of the game produced... It's ingenious, but irritating.

 

Check the README for more details.

Link to comment

You can use fusermount from user space too.

What I do here is :

fuseiso -p /where/iso/is/mounted/ Myiso.iso

(use it as I want)

fusermount -u /where/iso/is/mounted

 

I never type sudo here, and the -p option of fuseiso makes it to manage the mount point. It will create and delete it when mounting/unmounting. No need to create/remove dirs as root then :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...