Source

GemRB Launcher /

Filename Size Date modified Message
74 B
424 B
17.6 KB
7.6 KB
905 B
5.7 KB
11.7 KB
69.6 KB
4.3 KB
Nick Daly
    Email: myownlittlworld@hotmail.com
    Jabber: zanzabo@clanthac0.com

        A GemRB launcher that handles everything automagically?  Really?  Yup.
        Copyright (C) 2009 Nick Daly

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License along
        with this program; if not, write to the Free Software Foundation, Inc.,
        51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

        See the file "COPYING" for more details.

TOC:
    1. Intro.
    2. Setup Instructions
        A. CD Configuration Instructions
            i. CDs Copied to HD
            ii. CD images
            iii. CD images with CD# subdirectories
        B. Running Instructions
    3. Hacking Instructions



1. Intro

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:

1. Sets up an appropriate config file (really, just copies an already existing one)
2. Does startup configuration
3. Starts the game
4. Does shutdown configuration

For more information, check the launcher page on the GemRB wiki:
    http://linux.prinas.si/gemrb/doku.php?id=launcher

Also see the upstream homepage:
    http://bitbucket.org/nickdaly/gemrb-launcher/


2. Setup Instructions

To run it:

You'll need gksu (it's pretty standard, you should have it already) or
  fuseiso and fusermount.
You'll need pyGTK.
You'll need gemrb.



A. CD Configuration Instructions

Copy your regular GemRB.cfg file to each of:
    baldursgate1.cfg
    baldursgate2.cfg
    icewinddale1.cfg
    icewinddale2.cfg
    planescapetorment.cfg

You'll have to configure each config file for each individual game, so set the 
game_type, the title, and the CD data.



i. CDs Copied to HD

The CD data is a bit tricky, so be wary here.  If you've gone and copied the 
game data from each CD into directories on your system (or used the "full 
install" option in the installer), just set the CD1 through CD(whatever) 
variables to the correct directories, and you're done.

I don't believe GemRB currently works with using the actual CDs (it won't 
prompt you to "Insert Disc #...", and crashes instead), so I won't cover that 
here.  If it does become possible to use the actual CDs with GemRB, it should 
be possible to use the actual CDs by setting the CD1...CD# variables to your CD 
drive's directory (usually /media/cdrom).



ii. CD images

If you want to do things the complicated way and you've made CD images that 
exist on your harddrive, the launcher can cope with that too.  You'll need to 
add an extra entry or two per CD to your config file.

The first entry you'll need to add is:
    "CD#image="
This value tells the launcher where to find the CD image itself (usually 
something.iso) so it knows what it needs to mount.

At this point, the launcher can do one of two things: If mounting the CD to the
specified directory satisfies GemRB, you're done.  However, if you bought the 
games sometime after the initial release (especially for BG1:TOS) and have the 
weird omni-cds (CDs which in turn contain directories like CD2, CD3, CD4, etc - 
technically, they can be called "meta-discs", as they're discs that themselves 
contain other discs), you'll have to differentiate between the point where the 
CD image is mounted and the place that GemRB reads each CD's data from.



iii. CD images with CD# subdirectories

Let's take an example, the third disc of BG:TOS (the original Baldur's Gate 
with the Tales of the Sword Coast expansion included, sold some time in the 
early 2000's - a 3 CD set in total, encompassing the data of 6 discs).

A directory listing of CD3:

    BG_TOS_CD3/
        CD3/
        CD4/
        CD6/
    
As you can see, the third CD contains 3 subdirectories, each containing one of 
the original six discs in and of itself, making things annoyingly complex for 
the rest of us who tend to assume that 1 CD acutally is 1 CD.  The launcher, 
however, can handle even this strange situation.  You'll need to add another 
entry in your config file though:
    "CD#mount="
This tells the launcher where to mount a disc, great when using meta-discs like 
this one.  The trick is to mount the meta-disc itself as a primary directory 
and then have gemrb search for the CD data in the sub-directories.  In the case
of BG:TOS CD3, your config file would look like:

    # the disc image
    CD3image=/home/nick/bg_tos_cd3.iso

    # where to mount the disc image
    CD3mount=/tmp/bg_tos/disc3
    
    # where GemRB will read the CD data from
    CD3=/tmp/bg_tos/disc3/CD3
    CD4=/tmp/bg_tos/disc3/CD4
    CD6=/tmp/bg_tos/disc3/CD6

Just remember, each disc image contains the data from several CDs.  GemRB needs
to see each individual CD's data, not the list of CD folders.  I know it's 
confusing, but blame BlackIsle for making it confusing...

One last note about mounting CDs: If you're a member of the "fuse" group and 
the necessary executable files are available ("fuseiso" and "fusermount"), any 
disc images you need to mount will go through fuseiso, negating the need for 
root privileges.  If you're not a "fuse" member, the program will attempt to 
acquire root privileges to mount and unmount the necessary discs.  This should 
not be dangerous (the r/w/x privileges are set conservatively when the file is
made - and you can check the contents of the file before running it if you'd 
like) but, as always, be smart and trust no one.  Especially not the guy who 
tells you to trust him.



B. Running Instructions

Open a console, and type:
    ./autorun_gemrb.py [config_directory]

The config directory argument is optional and overrides the value found in the
autorun script itself. This should prevent you from needing to edit the script
at all, allowing it to be installed in a read-only location.

Then, watch the console output and hope it works.

I've tested it for Baldur's Gate 1 and 2, though it should work for all the
rest of the games, and you shouldn't need to do anything but set up the config
files for each game you plan on playing.

Hope you like it!



3. Hacking Instructions

To hack on it (to, say, add another game):

You'll also need Glade-3.

Open up the autorun-gemrb.glade file in glade-3, it should be somewhat
self-explanatory (I tried to keep it as simple as possible).

The key to note is that everything is based on the widget's names.  If you name
a button "play_the_mystery_of_fangdoodle", the launcher will search for a .cfg 
file named "mystery_of_fangdoodle.cfg".

The launcher will strip everything before and including the first underscore "_"
from the widget's name.  You could call it "fly_the_mystery_of_fangdoodle" and
it would still do the same thing.

So:
    Add your widget (set "Border Relief=None" for the sexy transparent effect)
        You can use any widget that responds to clicking, not just buttons!
        Or you can make a container button and add any widget you want!
    make sure it fires some "on_clicked" event
    edit the background as necessary (you can use .svg, .png, and probably
        .jpg, or any other picture format your heart desires)
    create the correct config file
    Enjoy and bask in your greatness!
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.