Configuration Hints

From Cube Wiki
Revision as of 17:59, 12 December 2014 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Basic Configuration

autoexec.cfg and config.cfg

These files reside in the base installation folder. If anything unusual happens -- like key bindings not working anymore -- you should be prepared to move (or even delete) your config.cfg. This file is autosaved during quit and executed upon engine start. It is used to keep values from one run to the next for persistent game settings and for any "on-the-fly" scripting you might have done during your last sessions. The trouble is... this may result in bogus data being saved -- the only way to win is: not to play -- so, just be ready for trashing config.cfg to return to a clean setup.

It will be written at every clean exit. If it doesn't exist it will initially contain whatever is in ./data/defaults.cfg - so never modify that file! It helps to remind yourself that config.cfg is actually just saved for what settings you may have changed during your previous session.

Since a few releases we now have personal home-directories used for the engine, which means you need to check that folder for the config.cfg too.

  • On Linux it's to be found in ~/.sauerbraten
  • On Windows somewhere inside C:\Documents and Settings and or on Windows 7 you may have to go to %LOCALAPPDATA% and navigate within that directory up to Program Files\Sauerbraten
  • On Mac "~/Library/Application Support/sauerbraten" is the correct destination

If this information is too sketchy for you, just perform a search over your harddisk for files called config.cfg!


Binding Keys

You can bind your own CubeScript to keys simply by adding appropriate lines to your autoexec.cfg.

bind P [ echo "I pressed the key P" ]
editbind P [ echo "I'm in editing and pressed P" ]

// Unfortunately, the fullscreen command only works on Linux and OS X
bindvar F2 fullscreen


If you want to use extra keys on your keyboard, that aren't bindable by default -- like German Umlaut keys for example -- you'll have to edit data/keymap.cfg. You need to know the ANSI code for the key and add it to the configuration. As an example -- here the required lines for those german keys:

// These keybindings have been added for DE support
keymap 223 SZ
keymap 252 UE
keymap 246 OE
keymap 228 AE

Then you can bind them just like CARET, HOME or KP_5 (e.g. any other key). If you are on Linux or Mac the tool to find out about the codes is called xev. Open a terminal and type:

xev|egrep "code|button"

The terminal is found in /Applications/Utilities/ on Mac OS X.