Topic: Running teeworld not from it's dir makes it not find it's data
In linux:
./teeworlds runs fine but for example teeworlds-dir/teeworlds makes it mad. This is a bit of a problem with launchers (gnome one's for example).
You are not logged in. Please login or register.
Teeworlds Forum → Support → Running teeworld not from it's dir makes it not find it's data
In linux:
./teeworlds runs fine but for example teeworlds-dir/teeworlds makes it mad. This is a bit of a problem with launchers (gnome one's for example).
you can try to write "cd teeworlds-dir; ./teeworlds" to start it.
Or either "./teeworlds-dir/teeworlds".
Or either "./teeworlds-dir/teeworlds".
no... then the game doesn't find the directories it needs...
This is the launcher script included with my Debian packages:
Just change basepath and binary to point to the teeworlds directory and the actual executable, save it somewhere in your path (possibly /usr/games/) and make it executable (chmod a+x /usr/games/teeworlds) then use it in your launchers.
#!/bin/sh
BASE_PATH=/usr/share/games/teeworlds/
BINARY=/usr/lib/games/teeworlds/teeworlds
QUIET=0
EXCUSE="\
Teeworlds client wrapper\n\
This script is Debian specific, it is *NOT* part of the source distribution!\n\
Usage: teeworlds [OPTION]...\n\
\n\
-h, --help\t\tDisplay this help\n\
-q, --quiet\t\tDisable console output\n\
-f <config>\t\tSpecify the path to an alternate configuration file\n
<command> <value>\tPass commands to the engine\n"
# Teeworlds binaries don't understand most "regular" command line parameters. Let's
# catch them here, to avoid accidently launching the binary.
while [ "$1" != "" ]; do {
if [ "$1" = "-f" ]; then
break;
fi
case "$1" in
-h|--help)
echo ${EXCUSE}
exit 0
;;
-q|--quiet)
QUIET=1
;;
esac
shift
}; done
# Ready to rumble!
cd ${BASE_PATH}
if [ ${QUIET} -eq 1 ]; then
exec ${BINARY} $* >/dev/null 2>&1
else
exec ${BINARY} $*
fi
exit $?
Alternatively, if you want something a tad simpler:
#! /bin/sh
cd /path/to/teeworlds
exec ./teeworlds
And do the same as above (put somewhere in your path, make executable, possibly include in launcher)
Hope that helps,
jscinoz
Teeworlds Forum → Support → Running teeworld not from it's dir makes it not find it's data
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.