Tutorial: Setting up a Mod: Addendum Last edited 1 year ago2022-10-16 17:37:38 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
This is an addendum to the original tutorial series, concerning other things you can customize for your mod that is within the realm of moving files around and scripting the config files, and outside the realm of actual mapping, modelling, programming, etc.

The general rule of thumb is that you can always omit stuff that you don't want to customize, as the game will read the default files from Half-Life (the valve folder).

Custom music

Whereas WON GoldSrc spins up your physical CD drive, the in-game music for the Steam version is included in the media/ folder. Customizing these simply involve adding mp3 files of the same name in the same location in your mod.

TrackerScheme.res

This file defines the UI scheme for GoldSrc's Steam UI, but you can have a custom one for your mod. Things such as UI colours, fonts for various elements, and borders are defined here.

To customize your mod's UI scheme, copy the original from <Half-Life>/platform/resource/TrackerScheme.res into <Half-Life>/<your_mod_here>/resource/TrackerScheme.res.

The following block, for example, defines the font properties for the game menu.
"MenuLarge"
{
    "1"
    {
        "name"        "Verdana"
        "tall"        "18" // increase this to make menu items larger
        "weight"    "1000"
        "antialias" "0" // set to 1 to enable anti-aliasing (why wouldn't you want anti-aliased texts?)
    }
}
And the following block defines its colours and metrics:
InGameDesktop
{
    "MenuColor"            "200 200 200 255"
    "ArmedMenuColor"    "255 255 255 255"
    "DepressedMenuColor" "192 186 80 255"
    "WidescreenBarColor" "0 0 0 0"
    "MenuItemVisibilityRate" "0.03"  // time it takes for one menu item to appear
    "MenuItemHeight"    "28"
    "GameMenuInset"        "32"
}

userconfig.cfg

This file is executed after config.cfg, and is a way to have a persistent command list that is not managed by the game (config.cfg gets overwritten by the game when cvars and keybinds change.)

One use case for userconfig.cfg is to define aliases. These are strings of commands you can execute in a single command, and bindable to keys. Aliases prefixed with + or - work as a pair, and used for keybinds (the + alias is executed on key down, the - one on key up). You can use this, and some script-fu, to have the Ctrl key toggle ducking, or a "bullet time" key.

settings.scr and user.scr

This pair of files is a way of mapping the GUI to cvars in ways not covered by the standard engine GUI. You can, for example, add a checkbox that toggles whether the game ignores textures embedded in maps (r_wadtextures), a text box to set your FOV (default_fov), or a drop down that lets you select between filtered or pixelated textures a-la software mode (gl_texturemode).

kbd_act.lst

This file, located in gfx/shell/, is the list of keybindable commands, as seen in the Options > Keyboard dialog. You may want to customize this file to give yourself and other players access to custom aliases you may have defined in userconfig.cfg.

commandmenu.txt

Half-Life and many first-party mods supports commandmenu.txt, though this feature is largely unknown outside of the Counter-Strike community.

You can use this feature, for example, to add a chapter selection menu, change cvars on the fly, or add a dev menu.
However, you'd need to edit gfx/shell/kbd_act.lst and add a keybind option for +commandmenu as per aforementioned.
Protip
If you want to have your menu's command accept a text input (such as entering a map name), set messagemode <command_name> as the command. This also applies to keybinds/aliases described elsewhere on this page.

skill.cfg

This file manages the skill system, defining NPC's health, ammo pickup, and damage dealt. Although it is strongly advised against editing these, it is one way of mod​ifying the balancing of a mod without diving into code.

The <game>_addon folder

Steam GoldSrc supports the [over]loading of files without overwriting the base file through the <game>_addon folder. This is also the case for HD and server-downloaded content via the _hd and _downloads suffixes.

Thus, some circumstances where separate mods were required before, might now be a simple drop-in into the valve_addon folder, without the risk of permanently corrupting your game.

To toggle the loading of this folder, go to Options > Video > Enable custom content.

This also works for mods! You can, for example, have addons for Poke646 populating the poke646_addon folder, and toggle them on and off.

The kitchen sink approach of this system is not great (compared to Source's custom/ folder) but it beats needing to surgically remove files, or reinstalling whole mods and losing saves due to corrupted modifications.

2 Comments

Commented 1 year ago2022-10-16 17:23:53 UTC Comment #104849
I thought the tutorial series needs an addendum as to what other things you might want to set up for your mod; stuff that isn't related to in-game content. Feel free to add whatever I may have missed.

Also it's past midnight and I have to postpone integrating this to the rest of the tutorial's navigation.
Commented 1 year ago2023-02-27 14:46:17 UTC Comment #105137
About the usage of -wadinclude compile command-line argument and game_text entities. I think they are better suited for addon pack where you "can't" edit the original files and copying/pasting the original ones is not an option as if everyone was doing that, it would "overlap".

For mods, shipping the WAD(s) and using titles.txt is fine since it's distributed as "standalone".

You must log in to post a comment. You can login or register a new account.