Tile World file location help (Linux)
#1
I installed the "tworld" package with APT, but it stores some files in "~/.tworld" like I would expect, but others (level sets and resource files) in "/usr/share/games/tworld". I would like everything to be in "~/.tworld", and I read somewhere in the documentation that I can specify different folders, but I can't find how to actually do it. Help please?
I eat chips! *crunch crunch crunch*
Reply
#2
For that you have to compile Tile World yourself, the package you installed is useless, you have to uninstall it.

Download the source code here:

www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.1-CCLPs.tar.gz

Extract it.

Open a terminal and navigate to the directory where you extracted the tarball. Run the following command:

./configure --with-sharedir=AAA

Replace AAA with the full path to the directory where you want the files to be stored.

Then run the following command:

make

Finally, run this command as root:

make install

And it should work. Hope this helps.
CC is awesome!

CC2 sets (still being updated): C1059-CC2 --- Walls of CC2

CC1 sets (all complete): C1059-2 --- C1059-1 --- 1059PG01 --- C1059-Christmas --- C1059-INSANITY --- C1059-CCLP4

My Youtube channel --- Fiver's Honeycomb --- Fanfiction.net

Good posts don't cost too much, yet many go unwritten.
Reply
#3
You have a few options.

  1. You can set the environment variable TWORLDDIR to change the default directory tree for all shared files. So you could add something like this to your .profile (or .bash_profile or whatever you use):

    export TWORLDDIR=~/.tworld

    <span style="font-family:arial, helvetica, sans-serif;"><span style="font-family:'courier new', courier, monospace;"><span style="font-family:arial, helvetica, sans-serif;"><span style="font-family:'courier new', courier, monospace;"><span style="font-family:arial, helvetica, sans-serif;">Note that this will create ~/.tworld/data, ~/.tworld/sets, and ~/.tworld/res, but your save files will still be in the top-level ~/.tworld directory, which is a little messy. But there's also a TWORLDSAVEDIR environment variable you can use, which will just change the default save directory. So you could do this:

    <span style="font-family:'courier new', courier, monospace;">export TWORLDDIR=~/.tworld
    export TWORLDSAVEDIR=~/.tworld/save



    which would probably be the closest to what you want.
  2. You can use command-line options -D, -L, and -R (and optionally also -S) to override the default directories individually:

    tworld -D datadir -L setsdir -R resdir -S savedir

    To avoid having to type all that out, you could create a tworld shell script in your personal bin directory that looked something like this:

    <span style="font-family:'courier new', courier, monospace;">#!/bin/sh
    DIR=~/.tworld
    tworld -D $DIR/data -L $DIR/sets -R $DIR/res -S $DIR/save



    Note that you can use the command "tworld -h" to see a full list of the command-line options, or "man tworld" to see more detailed documentation. Or the same documentation is available on the website.
  3. Finally, of course, you can compile Tile World yourself, and configure the default directories to be the way you want them to be. That's not as convenient, of course.




For the record, Tile World's file layout follows the standard Unix behavior of putting universal data (the level sets, sounds and graphics) in a shared location, and the user-specific data (your solutions) in a user-specific location.
Reply
#4
Alright, I tried compiling it myself, but I get this error:


[Click to Show Content]
I eat chips! *crunch crunch crunch*
Reply
#5
And yes, I am aware why the files are structured that way -- but I like to tinker with the data/res files, and my home folder is mounted to a separate partition that is shared by multiple Linux installs, so my settings are preserved even if I wipe and reinstall a distro or two. That way I don't have to re-widger the /usr/share stuff on each one.
I eat chips! *crunch crunch crunch*
Reply
#6
Ok, got it working with the command line options! Woohoo! I would still like to learn how to compile it myself though, and know what went wrong.
I eat chips! *crunch crunch crunch*
Reply
#7
What went wrong is that you don't have the SDL development package. (You have SDL installed, but you don't have the support files that let you build something that uses SDL.) Running "sudo apt-get install libsdl1.2-dev" would fix that.
Reply
#8
(Oh, and I would say that your use case is exactly the type of situation I had in mind when I added the environment variables feature to Tile World.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)