Tutorial: Setting up a Mod: Part 1 - Custom Game feature Last edited 1 month ago2024-09-23 01:00:33 UTC

This tutorial is originally written for the WON version of Half-Life.
Alternatives for the Steam version will either be:
  • Presented in a two-column table in the same page, or
  • Linked to a separate page in the navigation panel above

Putting Your Mod Into the Custom Game Menu

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:\Sierra\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 that the New Game and Hazard course options on the main menu will be disabled. This also 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_i386.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.

Either load up Half-Life, and go into the custom game menu. There you will see your shiny new mod! Activate it, and it will load.

An alternate method for both platforms is to run hl.exe (or hl.sh on Linux) with the -game npp argument.

Send in those mods!

See also

6 Comments

Commented 16 years ago2008-04-30 17:03:17 UTC Comment #100605
and then what i do?! to make a custom menu, models....
Commented 16 years ago2008-10-03 03:58:01 UTC Comment #100606
Nice Tut, and where can we get this NPP MOD? (im asuming you didnt stop working on it like I always do with MY mods.)
Commented 15 years ago2009-03-26 16:19:21 UTC Comment #100607
kc8kjp made a minimod template example map, here:
http://twhl.co.za/vault.php?map=4249
Commented 14 years ago2010-03-08 07:56:04 UTC Comment #100608
gamedll "dllshl.dll"
should be
gamedll "dlls/hl.dll"
Commented 14 years ago2010-07-24 09:04:26 UTC Comment #100609
how do i run it on steam?

edit: figured it out
Commented 1 year ago2023-01-20 01:23:30 UTC Comment #105012
I put the type "multiplayer_only" in my liblist.gam and it didn't work. any help?

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