.cfg: Difference between revisions

From Jedi Knight Wiki | JKHub
(Pretty much completely re-written)
No edit summary
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A CFG file is a plain text file containing a list of [[Cvar|cvars]] and/or [[Command|commands]], which are all [[exec|executed]] when the .cfg file run. They are commonly used to store [[Setting|game settings]], or execute multiple commands at once. CFG can stand for Context-free grammar or Configuration. The game automatically saves your settings to a config file which is automatically loaded when the game starts
A '''CFG''', or '''configuration file''', is a .cfg document that allows the player to group a list of [[command|commands]], or change numerous [[cvar|cvars]] simultaneously. [[the game|The game]] automatically saves your settings to a config file which is automatically loaded when the game starts.


==Syntax==
== Format ==
Simply list multiple commands and/or cvars on separate lines, or separated by semicolons. They can be created in any plain text editor simply by saving a document with the file extension ''.cfg'' instead of ''.txt''.
A .cfg file is a regular text file, usually renamed to have the extension ".cfg", although this is not required. The text file is then modified and filled with content, like so


==Related Commands==
{| class="wikitable"
* [[exec]] [config file path] - executes the named file within the [[Base Folder|base folder]] (or current [[mod]] folder).
|-
* [[write]] [file name] - saves your current settings to a new cfg file.
| [insert any commands/cvars]<br />[on a new line, add the next command/cvar modification]
|}


Most players customize there own .cfg files so they don't have to while in game.
The finished .cfg file can then be placed in [[PK3|.pk3]] file, or the [[Base Folder|base folder]].
 
== Execution ==
In order to execute a configuration file, type the following into the [[console]]:
 
{| class="wikitable"
|-
| exec [cfg name (no '.cfg' is required)]
|}
 
However, if you decided to create a configuration with another extensions, like .txt, then you must include the '.txt' in the cfg name.
 
== Special Configuration Files ==
* A configuration file titled 'autoexec.cfg' is automatically executed on game start.
* 'default.cfg' and 'mpdefault.cfg' are used in [[JKA]] to set the [[bind|binds]] for the game.
* In JKA, 'JASP.cfg' and 'JAMP.cfg' are created when the respective game is played, and they store the session's information there.
* Any cvar changed using [[Cvar|seta]] gets saved to .cfg files.
 
== Related Commands ==
* The [[write]] command writes a .cfg file
* The [[exec]] command (mentioned above) executes a given .cfg file
 
[[category:File Types]]

Latest revision as of 09:10, 5 May 2020

A CFG, or configuration file, is a .cfg document that allows the player to group a list of commands, or change numerous cvars simultaneously. The game automatically saves your settings to a config file which is automatically loaded when the game starts.

Format

A .cfg file is a regular text file, usually renamed to have the extension ".cfg", although this is not required. The text file is then modified and filled with content, like so

[insert any commands/cvars]
[on a new line, add the next command/cvar modification]

The finished .cfg file can then be placed in .pk3 file, or the base folder.

Execution

In order to execute a configuration file, type the following into the console:

exec [cfg name (no '.cfg' is required)]

However, if you decided to create a configuration with another extensions, like .txt, then you must include the '.txt' in the cfg name.

Special Configuration Files

  • A configuration file titled 'autoexec.cfg' is automatically executed on game start.
  • 'default.cfg' and 'mpdefault.cfg' are used in JKA to set the binds for the game.
  • In JKA, 'JASP.cfg' and 'JAMP.cfg' are created when the respective game is played, and they store the session's information there.
  • Any cvar changed using seta gets saved to .cfg files.

Related Commands

  • The write command writes a .cfg file
  • The exec command (mentioned above) executes a given .cfg file