Tutorial: Setting up a Mod: Part 1 - Mod directory and liblist.gam (Steam) Last edited 1 month ago2023-12-26 08:58:50 UTC

Tutorial: Setting up a Mod

Putting your mod in the Steam games list

I know you've been thinking in the past, things like: Blue Shift's too short. I could do better. DarkStar had far too many Headcrabs, or I need new weapons for HL, but I don't want to alter any code, models or skins.

Seems like you're wanting to create a mod! And why shouldn't you? After all, there are some great examples out there. A Mod doesn't have to be a whole new game with new weapons and ideas, after all, Mod is short for modification. A modification of the original game.

Anyway, back to business. In this guide, $INSTALL_DIR refers to the path of your Half-Life installation, assuming you kept the default installation directory, this is:
C:\Program Files (x86)\Steam\steamapps\common\Half-Life

Inside of the valve sub-folder, you'll find a file called liblist.gam. Right click on it and select "Open With" and choose "Notepad", or a text editor of your choice. You'll see some text which reads:
// Valve Game Info file
// These are key/value pairs. Certain mods will use different settings.
//
game "Half-Life"
startmap "c0a0"
trainmap "t0a0"
mpentity "info_player_deatchmatch"
gamedll "dlls\hl.dll"
gamedll_linux "dlls/hl_i386.so"
Looks pretty simple, eh? Yeah right!

Now go back to $INSTALL_DIR, and create a folder with the name of your mod. This won't be the final name, so abbreviate it if you wish. Now select the original liblist.gam file, copy it, and paste the copy into the new directory.

I'm making a mod right now which is HL in a nuclear power plant, so I created a directory called npp, and put the liblist.gam there.
Alternative no-DLL-copy method
An alternative method without copying DLL/SO files is available. Skip to the corresponding panel further down.

The rest of this section is retained below.
You must create some more files for this to work. Go into npp or whatever you have called your folder, and create a new folder. Call it cl_dlls.

Now go into the $INSTALL_DIR\valve\cl_dlls folder and Copy the client.dll file and Paste it into your mod's cl_dlls folder.

Now create another folder called dlls. Go into the $INSTALL_DIR\valve folder again and find the dlls folder. Copy hl.dll and paste it into your new dlls folder.
Linux notice
Instead of copying of the DLLs, copy the SO files.
Client and server dlls come in pairs. Never combine dlls from different mods as they were not made to work with each-other!
You now only really need one thing. A maps folder. Create one in your mod's folder.

Modifying the liblist.gam

Let's edit the liblist.gam in your new mod's file.

To change the name of the mod, delete Half-Life from the first line and replace it with the mod's name.

Now, put the BSP of the first map of the mod into the maps directory. Change c0a0 to the name of the BSP. If you have created a training map, change t0a0 to the name of the trainmap's BSP.

The rest can be left as it is.
Alternative no-DLL-copy method
You've come here from the part where you skipped copying the DLL/so files. If you followed the original instruction, ignore the contents of this panel.

Remove the lines in liblist.gam that start with any of the following:
gamedll
gamedll_linux
and write in its stead the following:
gamedll       "..\valve\dlls\hl.dll"
gamedll_linux "../valve/dlls/hl.so"
If you are making a multiplayer mod, however, you need to add a new line.

Enter in:
type "multiplayer_only"
This means you don't need a startmap and trainmap.

My nuclear power plant mod's liblist.gam is something like this:
// Valve Game Info file
// These are key/value pairs. Certain mods will use different settings.
//
game "Nuclear Power Plant"
startmap "foyer"
trainmap "t0a0"
mpentity "info_player_deatchmatch"
gamedll "dlls\hl.dll"
gamedll_linux "dlls/hl.so"
As you can see I left the original Training map t0a0 so the old Half-Life Hazard Course is available. And the first map that will run when I start my mod will be foyer.

Basing your mod off of another game/mod

The previous section creates a mod that is based off of Half-Life – it uses Gordon's view models, and the monsters and entities available are limited to those of Half-Life.

You want to make a mod of Blue Shift instead? Of course you can!

Inside your mod's liblist.gam file, add the following line:
fallback_dir "bshift"
This tells the engine that your mod is based off of the game/mod whose folder name in the Half-Life folder is "bshift" i.e. Blue Shift. The game code, as well as all the assets, will be loaded from "bshift" first if absent from your mod, then from "valve" which is the default and final fallback.
  • Using this method means the players would need to have the base game/mod installed in order to play your mod. For paid games like Opposing Force or Counter-Strike, that means they need to have already purchased said game. That said, this method is preferred over copying all files from that game into your mod which bloats the mod size and legally questionable.
  • You have to list the base mod as "prerequisite" for players looking to install your mod.
Loading DLLs
In the previous section, you might have replaced gamedll and/or gamedll_linux in your liblist.gam to load Half-Life's dlls directly. This need to be fixed again to properly load the DLL files of the base mod. Therefore, the gamedll and/or gamedll_linux lines should be edited to look as follows:
gamedll       "..\bshift\dlls\hl.dll"
gamedll_linux "../bshift/dlls/bshift.so"
Replace "bshift" with the base game/mod you're making a mod for. You should look at the base game/mod's dlls/ folder to get the actual name of the DLL/SO file to load.

Result

At the end, you should have a folder structure looking something like this:
<steam library>/steamapps/common/Half-life/
  ├─ hl.exe
  ├─ valve/
  │  ├─ liblist.gam
  │  ╰─ <other stuffs>
  ├─ npp/            ◄── your mod folder here
  │  ├─ liblist.gam  ◄── this file tells the engine and steam about your mod
  │  ╰─ maps/
  │     ╰─ <your maps go here>
  ╰─ <other mods and things>
Restart your Steam client and your mod should appear in the library.

An alternate method for both platforms is to run hl.exe (or hl.sh on Steam/Linux) with the -game npp argument.
✔️ At this stage, you have a minimum viable mod. It's enough for prototyping, iterating, and playtesting. The later parts of this tutorial series are mostly cosmetic and therefore optional.
Send in those mods!

See also

Comments

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