- Details
- Written by: INsane
- Category: Day of Defeat Commands (CVARs)
- Hits: 29
In this article I will place some notes on making basic .cfg (config) files.
There are many issues with Steam Cloud, placing the correct file in the right place and even... using the right keyboard key name.
Scripts are another pain, so below I will list some strange issues you may come across.
I will not get into scripting, this article is more about the basics and a few twists and turns that can really stuff up your files.
INDEX
| The basic .cfg (config) files | A list of common files, what they can do and where they go |
| The userconfig.cfg | A swiss army knife - a reliable place that will not break. |
| Making Binds | Easy right? Well there are a few issues you need to know. |
By default everyone has "config.cfg" file in their Half-Life 1 mod folder, in our case the "dod" folder "<Your Drive>:\SteamLibrary\steamapps\common\Half-Life\dod
To find that Folder \ File location...
Basically the config.cfg and files like it, hold your settings, keyboard and mouse binds, your game preferences in mouse movements, joysticks, graphical and movement options.Other commands as well although when using more advanced features like scripts, other files like a autoexec.cfg and a userconfig.cfg are used.
That file (and ones like it) is read line by line when you start a game, the settings are applied.
Understanding whats on each line is the tricky bit.
How to open a .cfg file?
First issue most have is how to open them, its just plain old Windows Notepad (others in Linux) or a good text editor like NotePad ++.
Common issues Steam Cloud sync.
I don't usually bother editing the "config.cfg" file at all and just use it to see whats changed.
The reason is its quite a dynamic file that can change from various things, you may change something and find... it didn't work.
Enter something you need to know about... Steam Cloud. It can be REALLY annoying and here is a typical complaint of a user changing something and it didn't stick.
Steam > Settings > Cloud > Enable / Disable Steam Cloud ... That... is what I use.
I use other files to change settings and just leave the config.cfg AND the other .cfg files in dod standard, there are too many issues editing them.
Use these instead and... place them in a folder Steam can't kill them.
I found the best combination is utilizing the "Half-Life\dod_addon" folder for config files, and I use a basic "userconfig.cfg" file in there.
The dod_addon folder acts like a "dod" folder when loading a game, config files, Models, HUD and GUI, Sprites... almost everything that is custom will work in there... but don't put maps in there... put maps in the "Half-Life\dod_downloads" folder.
Making one from scratch, its just making a .txt file, save in notepad via Save As Type and name it "userconfig.cfg".
It that is a mystery... hell just copy the config.cfg out of the dod folder, paste that into the "Half-Life\dod_addon" folder and rename it userconfig.cfg.
Select all the contents and delete all of it... you have a blank file.
Now whatever you put on each line, the commands you put there will override the config.cfg in the "dod" folder, it will even change it after you run a map.
Lets start with a easy one on the first line...
echo my new userconfig loaded
Then save the file. "echo" is a command that just repeats the text after it, prints that in the developer console.
Start a game and open the developer console... you will see the message, its a good way of knowing that your new file is actually working.
OK.... if that test passed you have a reliable way now of holding your settings... that steam cannot overwrite and even if you dod game files are "verified" it will stay there.
There are all sorts of contents you put in that file. A player config for competitive players is one use case. All sorts of items like scripts (good and bad) and ones you should not use on a server... you will be spotted and banned.
The name userconfig.cfg is self descriptive... its your config file you change that also overwrites the dod\config.cfg with what you want.
The use case for having even more config files is some items I use, like a special config file to have binds for the various bot waypointing binds.
I have four different ones that alter my binds... all are different.
These are the same format and use of the "userconfig.cfg", I separate the contents of them from that file as it makes it difficult to manage.
To activate a "special_name.cfg" file I just do this one line in the userconfig.cfg file...
exec new_bot_menu.cfg
"exec" command will look in the "Half-Life\dod_addon" folder and find a file called "new_bot_menu.cfg" and run it. It acts the same as the userconfig.cfg, issuing commands, binds and scripts line by line.
When I am done with that special file I just put a "//" in front of the line and it will not load again, load up a different one...
exec marinebot_binds.cfg // This makes the special Keypad binds work for waypointing
//exec new_bot_menu.cfg // This makes the special Keypad binds work for waypointing
That is actually an important thing to remember, only run one special script at a time as you could have overlapping settings in each one.
This use case for a userconfig.cfg file would be the most common, its a easy format to do, same as doing it in the developer console in source games.
There are some quirks too in goldsource games.
Don't overwrite keys you are using! Consult your config.cfg file.
One thing that is handy, as you make binds make sure you are not overwriting some game keyboard defaults.
To avoid this, remember I said I don't touch my config.cfg file in Half-Life\dod ?
That is why... use that file as reference of what you have already bound to a key or mouse switch.
The Keypad * or Keypad multiply key issue. (KP_MULTIPLY or KP_STAR)
This key if you follow the defaults... it will not work.
It is a little known frustrating issue mentioned here and here.
The solution use "KP_MUL" in Half_Life 1 mods, it was a issue solved here in 2013...
Added support for binding the multiply key on the numeric keypad, the engine bind name for this new key is "kp_mul"
Stupid I know but it really took time finding a solution for that one.
There are of course other keys you need to avoid, printscreen, scroll lock, pause, number lock (on the keypad area) but there are quite a few to grab in dod.
Designed by INsane Webmaster - dodbits.com using Template Toaster (Joomla! Version 4)
