Tutorials

Custom Menu



Mod Title
The Game Title for the main menu can be changed by editing the file gameinfo.txt (found in the root of you mod folder). Open up the File and you'll see something like this:

"GameInfo"
{
game "HALF-LIFE 2"
title "HALF-LIFE'"
type singleplayer_only

FileSystem
{
SteamAppId 220 // This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.

SearchPaths
{
Game |gameinfo_path|.
Game hl2
}
}
}
---

To change it you'd simply replace the titles for 'game' and/or 'title' with whatever you would like to name your game.

game- is the name of the application, as to be seen in your taskbar
title- is the name as to be seen in the main title text

In my example I shall call the mod Murder William:

"GameInfo"
{
game "Murder William"
title "MURDER WILLIAM"
type singleplayer_only

FileSystem
{
SteamAppId 220 // This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.

SearchPaths
{
Game |gameinfo_path|.
Game hl2
}
}
}

If you were to change this now you would probably have some weird shapes as your title, the reason for this is because there is a custom font being used that was created specifically for half-life 2. In that particular font the not-needed letters are replaced by logo's, weapon icons and whatnot. Unless you want to call your mod something like 'All Hail Life 2' you're gonna need to add you own font, You can change the font in the Clientscheme.res file.


Changing the Font
Half-life 2 uses True Type Fonts (.ttf) so find or create the font you are going to use and put it in the resource folder. It is NOT recommended you rename the font file as the name of the file must match the typeface name it gets from being created (double click a .ttf file, near the top look for 'Typeface name:').

Next up you need to open up ClientScheme.res (resource/ClientScheme.res) and scroll to the bottom. You will see something like this:

CustomFontFiles
{
"1" "resource/HALFLIFE2.ttf"
"2" "resource/HL2crosshairs.ttf"
}

This is where the fonts are defined. It is simply declaring where to find your font file (.ttf file). Add a new one like so:

CustomFontFiles
{
"1" "resource/HALFLIFE2.ttf"
"2" "resource/HL2crosshairs.ttf"
"3" "resource/impact.ttf"
}

Now that you have added the font you'll need to define where it is to be used. Still in ClientScheme.res look further up and you'll find this:

ClientTitleFont
{
"1"
{
"name" "HalfLife2"
"tall" "46"
"weight" "0"
"additive" "0"
"antialias" "1"
}
}

Simply replace 'HalfLife2' with whatever the name of your font is, in this example it would be 'impact'

Chapter Buttons
When you click new game in Half-life 2 it shows a list of the chapters. You can change these to something more appropriate for your mod.

The Chapter titles are defined in the file resource/hl2_english.txt (or indeed whatever language you need). Open up the file and it looks something like this:

"HL2_Chapter1_Title" "POINT INSERTION"
"HL2_Chapter2_Title" "\"A RED LETTER DAY\""
"HL2_Chapter3_Title" "ROUTE KANAL"
"HL2_Chapter4_Title" "WATER HAZARD"
"HL2_Chapter5_Title" "BLACK MESA EAST"
"HL2_Chapter6_Title" "\"WE DON'T GO TO RAVENHOLM...\""
"HL2_Chapter7_Title" "HIGHWAY 17"
"HL2_Chapter8_Title" "SANDTRAPS"
"HL2_Chapter9_Title" "NOVA PROSPEKT"
"HL2_Chapter9a_Title" "ENTANGLEMENT"
"HL2_Chapter10_Title" "ANTICITIZEN ONE"
"HL2_Chapter11_Title" "\"FOLLOW FREEMAN!\""
"HL2_Chapter12_Title" "OUR BENEFACTORS"
"HL2_Chapter13_Title" "DARK ENERGY"
"HL2_Chapter14_Title" "CREDITS"

Rename the chapter titles in the right column to whatever you need them to be.

The other factor of chapters is the chapter images which also show up in the new game menu, these images are located in vgui/chapters/ you'd simply need to overwrite these images with your own and all should be well, so long as you keep the filenames the same.

The Background Image
The Background menu for Half-life comprises of two things. A static image and a map, the image stays on the screen until the map is loaded.

NOTE: For some reason the image dimensions need to be to the power of 2, although once working it won't be loaded that size? The way to counter this is to make the image as 1024x768 and then once complete stretch it in your favourite image editing software to the power of 2 (1024x1024) The image will obviously look distorted at these dimensions but it will correct itself once up on your main menu screen.

Convert your .tga into a .vtf file and name it background01.vtf and place the file in the materials/console folder. Fire up the game now and if all has gone well you should have
something like this:
news post image

Of course If you leave it like that its still going to use the half-life 2 background maps until you either disable them or replace them with your own. If you are replacing it just make sure your map is called background01, you can find more information on background maps in the SDK documentation.

Mr Greenfish

View comments ( 45 )

Back to top