[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Most applications have an accompanying configuration file which describes configuration options particular to that application. Similarly, most plug-in modules have have their config file. Configuration files are named with the file extension `.cfg' and are typically located within the virtual directory `/config/' which is most usually mounted at the physical location `CS/data/config'.
The format of these files is simple. They consist of a number of keys, each of which consists of a name, a value and an optional comment. Key names contain dots to create some kind of hierarchy, similar to a file system: `Video.OpenGL.EnableDither'. This should be interpreted at the key `EnableDither' in the sub-section `OpenGL.', which resides in section `Video.' (note that the dots are part of the section names).
The file itself looks like this:
; This is the comment for Section.Keyname Section.Keyname = Value ; Comments may be ; several lines long ; The option 'Section.TestOption' has no comment attached to it. Video.OpenGL.EnableDither = true Section.TestOption = false ; Comments at the end of the file do not belong to any configuration ; key. When a config file is loaded and saved again later this ; end-of-file comment is put back at the end of the config file. |
When you run an application, all configuration domains are combined to one big database of options. When this happens, options from higher-priority domains override options from lower-priority domains. These domains are (from low to high priority):
System->Initialize(argc, argv, ConfigFile)
. This file
defines the default values for the application configuration, and can
override the configuration for plug-in modules if an application requires
this.
This domain is intended for users who want to override the configuration from the lower-priority domains explained above. This is an application-neutral domain, so any options you define here are used by all applications.
Warning: Currently this domain does not yet properly support multi-user environments. All options are stored in `CS/data/config/user.cfg' and are prepended with the string `Global.'. So for example the option `Walktest.Settings.FPS' will be called `Global.Walktest.Settings.FPS'.
Warning: Currently, this domain not yet properly support multi-user environments. All options are stored in `CS/data/config/user.cfg' and are prepended with the string `ApplicationID.', where `ApplicationID' is defined in the user-neutral, application-specific config file (e.g. `walktest.cfg').
Thus you can set any option in your application's config file to override options from the plug-in config files. And you can again override those options with a line in the user configuration.
If the application tries to change options in the config file, these changes are always applied to the user-specific, application-specific domain. The only exception are applications that disable the user configuration altogether, in which case the changes are applied to the user-neutral, application-specific configuration.
3.2.1 System Configuration 3.2.2 Graphics Configuration 3.2.3 Engine Configuration 3.2.4 Sound Configuration 3.2.5 Console Configuration
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |