Tutorial: Setting up a Mod: Addendum Last edited 1 year ago2022-11-16 13:15:25 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 to consider for your mod that is not covered in previous articles, and outside the realm of actual mapping, modelling, programming, etc.

Other things you can customize

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.

A Mod, or an Addon Pack? 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 disambiguate, lets call the _addon folder use case as an Addon Pack instead of a Mod.

Is my content a Mod or an Addon Pack?
Your content might be an Addon Pack if: On the other hand, you must distribute as a Mod if: So, what changed?
An addon pack installs differently to a mod. Firstly you don't need the liblist.gam just to add, say, custom models to Half-Life. Secondly, players can mix and match other things in their games, and they can toggle them on or off (details below), or otherwise jump between vanilla and modded setup quickly.

Other things about addons
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.

Distributing your mod/addon pack

You have your mod (or an addon pack). You want others to play them. You need to send these files to them. This raises a question: how, where, and which files?

What to [not] include

This depend on your intention, whether it is a general release, or a source release.

In general, whatever is custom to your mod, include them. To be absolutely safe, run your map through a RES file generator. Whatever files it lists in there, include them, unless they're part of the standard Half-Life asset which you don't have to.

But for a general release, you wouldn't want to include everything you've been working on; only the end products needed for the game engine would suffice. These are the maps, models, sprites, sounds, skyboxes, textures, the other files aforementioned earlier on this page, etc.
Some tips to reduce dependencies (and files to ship)
  • Compile your map with -wadinclude, so that all textures are baked into the BSP and you don't need to distribute the WADs you used.
  • Use game_text instead of a modified titles.txt means not having to override someone else's titles.txt (applicable to custom mission addons only)
Help people contribute to your mod!
  • If your mod contains custom code/entities, include the FGD.
  • If your mod has a distinct style/setting, include your WADs (and your .rad files too!)

Packing the files

The best practice is to pack the files into a ZIP archive, as most OSes natively support it. Other archive formats would require would-be players to have the associated files, and the compression improvements are insignificant.
Do not create an installer, as was common in the 00s. Those often make assumptions that can be obsoleted (e.g. past installers assuming you have WON or pre-SteamPipe Steam configurations), create clutter on people's systems (e.g. desktop icons, entries in "installed programs", and uninstallers, all of which cease to work if you move your Steam library), and generally confuse more than help contemporary players.
For mods:
  1. With the Half-Life directory open, take the folder that contains your mod, and put it into an archive.
  2. Once the archive is created, check that inside the archive is that same folder, and the directory structure is preserved.
  3. If you have working files you wish to exclude, remove them at this stage.
For addon packs:
  1. With the addon folder open, select every file related to your content pack and add them to an archive.
  2. Once the archive is created, check that the archive contains your files and the directory structure is preserved (not flat.)
  3. If you have working files you wish to exclude, remove them at this stage.

Installation

To help would-be players, include a readme file in the archive directing them to extract the archive into the correct installation folder. Also provide them information to verify what a correct installation looks like.
Example install instruction for a mod:
INSTALLATION
1. Extract the archive into <steam/library/path>/steamapps/common/Half-Life
2. After extraction, find the folder <modfolder> inside the above path, in the same place as the valve folder.
Example install instruction for an addon pack:
INSTALLATION
1. In <steam/library/path>/steamapps/common/Half-Life, create folder named "<gamefolder>_addon" if it doesn't already exist.
1. Extract the archive into <steam/library/path>/steamapps/common/Half-Life/<gamefolder>_addon.
2. After extraction, find the files inside the <steam/library/path>/steamapps/common/Half-Life/<gamefolder>_addon folder.
Never instruct players to install into valve (or other mods) and overwrite the existing files. You may corrupt their existing games/mods, and when they're done with your stuff they have no choice but to reinstall the game/mod, and they they wouldn't be happy about it.

Hosting the files

There are several places on the Internet that can host your mod/addon files, including: Some of these sites require you to fill a form, so have these information figured out in advance: which brings us to...

Licensing

Note: this is not legal advice.

It's the last thing on your mind when you're in the zone. You might assume it'd be one of "here's the files, do whatever" or "credit me if you do stuff with it" and you'll be correct, but the platforms you distribute your mod under has other assumptions, and you may not want to go with the default.

The website https://choosealicense.com/ can help you decide which license you want to distribute your mod under. Then, select the appropriate license type on the hosting website's upload form.

A few pointers:

In The End

Congratulations! You've published your mod (or addon pack)!

Hopefully the series has been helpful in assembling and getting your stuff out into the world, for other people to enjoy.

2 Comments

Commented 2 years 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.