This is the sidebar
After discussing settings and variables in the past episodes this time we will have a look at config files and what happens with them if you launch and close Nexuiz. Would be a shame if these nice tweaks you did got lost due to improper handling of your config, right?
After watching this episode you will be able to
Spread the word!
The main configuration file is called config.cfg. It's main purpose is to hold the changes made in the Nexuiz's config menu. Therefor it is rewritten from scratch every time you close Nexuiz. This implies that it can only hold variables that are automaticcaly saved on shutdown (refer to last episode). If you find the changes you made by hand to config.cfg to be lost use autoexec.cfg instead.
exec
: execute another config fileexec <configfile>
set
: creates new variables or changes values of existing onesset <name> ”<value>”
(mind the quotes)set <varname> ”<value>” ”<description>”
seta
: “permanent” version of set
set
seta
will be saved to config.cfg if applicable
Hello and welcome to episode no. 4 of the Nexuiz In-Depth video podcast. My name is Marius Shekow aka GreEn`mArine and this time
seta
command, but I'll come to this one in a second.exec
command. The syntax for its usage is to enter exec
and then the name of the config file. This config file is just a textfile. Here I've opened a sample file called test.cfg which is located in my data folder of Nexuiz, that sets the timelimit to 5 and then, in the next line, just shows me a message on the console that it did that. Now in nexuiz when I do exec test.cfg
, it will open the file and go through each line and act as if I had written the content of this line into the console myself. It will first set the timelimit to 5 and then, immediately after, show me the message of the echo
command.exec b.cfg
was replaced by the content of file b.cfg.set
command which is used very often too:set
, followed by the <name>
and <value>
of the variable, creates a new variable with the specified name and value. If the variable already existed it will just modify its value. However, if you know the variable existed already, you don't have to write the set
, but it won't be of any harm either! Also keep in mind that it is recommended to quote the value of the variable, especially if it is a phrase that has spaces in it, e.g. set my_new_var “hello Benjamin”
set nameOfVar value “my description”
)seta
seta
command. seta
works just like the set
command regarding its syntax. seta
will also create a new variable with the specified name, value and description, or modify one that already existed. But what seta
additionally does is to mark the variable to be a saved variable, which means that once you close nexuiz, it will automatically save the value to your config file, as opposed to variables created with set
which won't be saved. But keep in mind that marking a variable as saved only works if seta
created a new variable, not when modifying an existing one! This means that you can't convert existing non-saved variables to saved variables permanently.config.cfg
. Note that what ever is contained in your config file, it will overwrite the variables or keybinds from the default.cfg
.autoexec.cfg
. If you don't have it yet you need to create it in your Nexuiz/data folder, or when you are on linux you would normally create it in the /home/username/.nexuiz/data folder that I showed to you earlier. In this file you can put anything you like and you can be sure that all variables or keybinds you put there will be applied once the game is loaded. You usually use this file to overwrite values of variables that are normally not saved to the config, and you also use it for defining aliases, which I'll explain in another session. It also very handy to make sure the value of a few variables are reseted to the default you want it to be, especially for variables that you might sometimes change during the game, such as your in-game nick.saveconfig
, which completely rewrites your config.cfg from scratch. Btw, you can use this command manually by entering it in the console, to make sure that variables you changed are really saved. The problem is that sometimes, when nexuiz crashes due to some problems, that saveconfig command is NOT called, and all changes you did to variables or keybinds since the last start will be lost. Now you might wonder: well, what is actually being saved to the config?saveconfig
command will rewrite the config.cfg from scratch each time you close nexuiz, which means that in many cases just putting something into your config file manually with a text editor will fail, because what ever you changed probably affected a non-saved variable. If this happens to you, place these changes in your autoexecute config instead!
Now you know what happens when opening and closing Nexuiz, and I hope I was able to demonstrate the config loading and saving mechanisms of the game. I know that all this console stuff isn't as exciting at times, but it is needed as a foundation to understand upcoming tutorials. In the next episode I'll show you a few tricks how you can modify from which location the config files are loaded, which allows easy configuration for multi-user or multi-purpose environments that you never thought were possible. This was GreEn`mArine for the AT dev team, have a good time and cu next week!
GFDLcontent Unless mentioned on the licensing page, the work on this page is licensed under the GNU Free Documentation License. The author states that the text and images can be used within the restrictions of this license (for example, they can be incorporated into certain free encyclopedias such as Wikipedia). | |
Kindly hosted by NexuizNinjaz.com |