Miscellaneous
description
Set up your own Half-Life 2 modification.
keywords
mod, modification, mods, set, up, setup.
Complete guide for customizing a single-player mod. (setting-up the simple custom.bsp file to make it start like that Half-Life2 does)
This tutorial will teach you how to take your custom.bsp level and add the ingredients to make it start in the elaborate way that Half-Life2 starts.
NOTE:
Few of the steps are well-known from the other tutorials, but I wanted to extract the important steps and assemble the relevant part in a compact, easy understanding tutorial.
1. After you finished the work on your single-player levels, you need to set them up to resemble like a complete job.
Open up the <Source SDK> window, from Steam menu (or desktop shortcut), in the lower part of the <Source SDK> window be sure to select Current Game: Half-Life 2

In the Utilities menu, select Create a Mod and launch it

In the <Create a Mod> window be sure to check Modify HL2 Single Player
Next >In the <Mod information> window select the destination directory of the basic HL2 Single Player source code (less important for our lesson, but is necessary for Steam to continue). The important step is to name your mod, which will be saved in the \SourceMods folder. Lets name it <MySPmod>.
Next >
After copying the necessary files, Next > and Finish.
2. Now we begin our work.
Let’s go in the <MySPmod> folder we created with Steam’s help under the \SourceMods folder.
<....\valve\steam\SteamApps\SourceMods\MySPmod>
Steam created these files:

(into the \resource and \scripts folders, Steam created A LOT of files, that we REALY DON’T NEED to start-up our level with this tutorial)
So you can safely delete the following files:
- from \resource folder:
• <DIR> ui
• CombinePanelScheme.res
• GameEvents.res
• hl2_french.txt
• hl2_german.txt
• hl2_italian.txt
• hl2_japanese.txt
• hl2_korean.txt
• hl2_koreana.txt
• hl2_portuguese.txt
• hl2_russian.txt
• hl2_schinese.txt
• hl2_spanish.txt
• hl2_tchinese.txt
• hl2_thai.txt
• serverevents.res
• SourceScheme.res
So we left only:
• ClientScheme.res
• GameMenu.res
• hl2_english.txt
- from \scripts folder:
• <DIR> effects
• <DIR> screens
• <DIR> talker
• actbusy.txt
• credits.txt
• debugoptions.txt
• decals.txt
• decals_subrect.txt
• dsp_presets.txt
• EngineVGUILayout.res
• game_sounds.txt
• game_sounds_ambient_generic.txt
• game_sounds_header.txt
• game_sounds_items.txt
• game_sounds_manifest.txt
• game_sounds_physics.txt
• game_sounds_player.txt
• game_sounds_ui.txt
• game_sounds_vehicles.txt
• game_sounds_weapons.txt
• game_sounds_world.txt
• global_actors.txt
• HudAnimations.txt
• HudLayout.res
• hud_textures.txt
• kb_act.lst
• kb_def.lst
• kb_keys.lst
• level_sounds_breencast.txt
• level_sounds_canals.txt
• level_sounds_canals2.txt
• level_sounds_citadel.txt
• level_sounds_coast.txt
• level_sounds_eli_lab.txt
• level_sounds_k_lab.txt
• level_sounds_k_lab2.txt
• level_sounds_music.txt
• level_sounds_novaprospekt.txt
• level_sounds_ravenholm.txt
• level_sounds_ravenholm2.txt
• level_sounds_streetwar.txt
• level_sounds_streetwar2.txt
• level_sounds_trainyard.txt
• npc_sounds_alyx.txt
• npc_sounds_antlion.txt
• npc_sounds_antlionguard.txt
• npc_sounds_attackheli.txt
• npc_sounds_barnacle.txt
• npc_sounds_barney.txt
• npc_sounds_birds.txt
• npc_sounds_blackheadcrab.txt
• npc_sounds_citizen.txt
• npc_sounds_combinecamera.txt
• npc_sounds_combine_ball.txt
• npc_sounds_combine_mine.txt
• npc_sounds_dog.txt
• npc_sounds_dropship.txt
• npc_sounds_eli.txt
• npc_sounds_env_headcrabcanister.txt
• npc_sounds_fastheadcrab.txt
• npc_sounds_fastzombie.txt
• npc_sounds_gman.txt
• npc_sounds_gunship.txt
• npc_sounds_headcrab.txt
• npc_sounds_ichthyosaur.txt
• npc_sounds_manhack.txt
• npc_sounds_metropolice.txt
• npc_sounds_poisonzombie.txt
• npc_sounds_rollermine.txt
• npc_sounds_scanner.txt
• npc_sounds_sniper.txt
• npc_sounds_soldier.txt
• npc_sounds_stalker.txt
• npc_sounds_strider.txt
• npc_sounds_turret.txt
• npc_sounds_vortigaunt.txt
• npc_sounds_zombie.txt
• plugin_animations.txt
• propdata.txt
• sentences.txt
• settings.scr
• soundmixers.txt
• soundscapes.txt
• soundscapes_canals.txt
• soundscapes_citadel.txt
• soundscapes_coast.txt
• soundscapes_elab.txt
• soundscapes_klab.txt
• soundscapes_manifest.txt
• soundscapes_prison.txt
• soundscapes_streetwar.txt
• soundscapes_town.txt
• soundscapes_trainyard.txt
• surfaceproperties.txt
• surfaceproperties_hl2.txt
• surfaceproperties_manifest.txt
• titles.txt
• vgui_screens.txt
• weapon_357.txt
• weapon_alyxgun.txt
• weapon_annabelle.txt
• weapon_ar2.txt
• weapon_bugbait.txt
• weapon_citizenpackage.txt
• weapon_citizensuitcase.txt
• weapon_crossbow.txt
• weapon_crowbar.txt
• weapon_cubemap.txt
• weapon_frag.txt
• weapon_physcannon.txt
• weapon_physgun.txt
• weapon_pistol.txt
• weapon_rpg.txt
• weapon_shotgun.txt
• weapon_smg1.txt
• weapon_stunstick.txt
So we left only:
• ChapterBackgrounds.txt
• gameinfo.txt
• liblist.gam
3. Ok. Next we will create a few new folders needed for our customization.

Now it will look like this:

4. Now we need to create/copy some files into \cfg and \media folders.
1st we have to copy the file <valve.rc> from <....\valve\steam\SteamApps\your_username\half-life 2\hl2\cfg> folder into <....\MySPmod\cfg> folder.
2nd we will create 3 .CFG files into <....\MySPmod\cfg> folder with the names: <chapter1.cfg>, <chapter2.cfg> and <chapter3.cfg> (we will get back on what these files LATER) like this:

3rd we will create 1 .TXT file into <....\MySPmod\media> folder and name it <StartupVids.txt> (we will get back on what these files LATER)
5. Good. Now we’ll put our .BSP files into the <....\MySPmod\maps> folder.
6. We will leave the start level set-up for a little bit, for the Main Menu customization.
(This tutorials also follows most of the steps, regarding the Main Menu customization)
69th Vlatitude
http://www.vlatitude.com/tutorials.php?tutID=63
VALVE erc - Making a Menu Background Map
http://www.valve-erc.com/srcsdk/Levels/background_maps.html#Construction
SourceWiki - Main Menu Editing
http://www.sourcewiki.org/wiki/index.php/Main_Menu_Editing
SourceWiki - Main Menu Editing Part 2
http://www.sourcewiki.org/wiki/index.php/MainMenuEditingPart2
(I will try to resume them, and not only this ones, into a simple and fast way)
So, first let’s start making a static background (for now, the static background is the fastest way to escape from loading the default Half-Life2 3D background, which in most cases takes a lot of time).
The fast way to edit a picture is Adobe® Photoshop®, so you will need the “VTF Photoshop plug-in v1.03” by Ryan Gregg ( ryansgregg@hotmail.com ), http://nemesis.thewavelength.net/index.php?p=39 (DOWNLOAD: http://nemesis.thewavelength.net/files/files/vtfplugin103.zip ) a useful tool for creating simple .VTF files; and the “Windows XP/2000 .VTF Shell Extensions v1.0” by Neil "Jed" Jedrzejewski ( jed@wunderboy.org ), http://www.wunderboy.org/3d_games/utils/sourcetools.php#vtf_shell (DOWNLOAD: http://www.wunderboy.org/download.php?file=VTFShellExtensions.zip&s=1 ) if you want the Windows Explorer to visualize your .VTF files.
Unleash your magic and create your 1024x768 future background picture in Photoshop®. For some reason the Source engine needs the image dimension to be to the power of 2, so don’t forget to resize your image to a power of 2 size: 1024x1024 (if you worked with multiple layers in Photoshop® you’ll need to flatten them: in the menu --> Layer / Flatten Image). Save your work in the .VTF format. Place the VTF into <....\MySPmod\materials\console> folder with the name <background01.vtf>.
Now we need to tell Source engine to load this map/picture. There are 2 ways:
1st is to tell the engine to load only this map, so you have to open <....\MySPmod\scripts> folder and edit the <ChapterBackgrounds.txt>:
- when opened, you will find something like this:
"chapters"
{
1 "background01"
2 "background01"
3 "background02"
4 "background02"
5 "background03"
6 "background03"
7 "background04"
8 "background04"
9 "background05"
9a "background05"
10 "background06"
11 "background06"
12 "background07"
13 "background07"
14 "background07"
15 "background07"
}
[size=12]- replace it with this:
"chapters"
{
1 "background01"
}
Save it.
And now the engine will load ONLY your static background image.
2nd step is to open <....\MySPmod\cfg> folder and edit the <valve.rc> (use Notepad to edit):
- when opened, you will find something like this:
// load the base configuration
//exec default.cfg
// Setup custom controller
exec joystick.cfg
// run a user script file if present
exec autoexec.cfg
//
// stuff command line statements
//
stuffcmds
// display the startup level
startupmenu
- at the end of the text find startupmenu and “comment” it:
// display the startup level
// startupmenu
Save it.
And now the Half-Life2 default 3D background map should be replaced with a constant static image.
7. Now when we finished customizing the static background image, let’s move forward and create a custom Game Title with a custom FONT also.
1st, if you have a custom font, take it and copy it into <....\MySPmod\resource> folder. Be sure to be a .TTF - TrueType Font. Now let's tell the game engine how to read our custom font. Open up the <ClientScheme.res> file (use Notepad to edit) from <....\MySPmod\resource> folder and lets edit it:
- you will find there a ton of rows, just scroll down till you will find the following line:
ClientTitleFont
{
"1"
{
"name" "HalfLife2"
"tall" "46"
"weight" "0"
"additive" "0"
"antialias" "1"
}
}
- now edit the lines like following:
ClientTitleFont
{
"1"
{
"name" "Font name"
"tall" "46"
"weight" "0"
"additive" "0"
"antialias" "1"
"custom" "1"
}
}
Save it.
- in the line "name" "Font name" you need to get the true name of the font from inside the font file rather than just using the name of the font file:
(for example, I used in this tutorial the Matrix vs Miltown font (free font) theme from The Matrix® movie)

- now we have to tell the game engine where to find this custom font. In the same <ClientScheme.res> file, scroll till the end of the text and find the following line:
//////////////////////// CUSTOM FONT FILES /////////////////////////////
//
// specifies all the custom (non-system) font files that need to be loaded to service the above described fonts
CustomFontFiles
{
"1" "resource/HALFLIFE2.ttf"
"2" "resource/HL2crosshairs.ttf"
}
- and add the folowing line:
CustomFontFiles
{
"1" "resource/HALFLIFE2.ttf"
"2" "resource/HL2crosshairs.ttf"
"3" "resource/matrix_cyr.ttf"
}
Save it.
- in the line "3" "resource/matrix_cyr.ttf" replace matrix_cyr.ttf with the file name of your font.
2nd, after we finished telling the game engine to use our custom font, now let's change the Game Title.
First we have to edit the file <gameinfo.txt> from <....\MySPmod> root folder. Open it up and you will find these lines:
"GameInfo"
{
// This is what shows up in the 'Third Party Games' area of the Steam games list.
game "Half-Life 2 Mod"
FileSystem
{
- now lets add a few lines, and tell the engine what’s the name of our single-player mod:
"GameInfo"
{
name "MySPmod"
game "MySPmod"
title "P I T U L O N"
title2 "No 1"
type singleplayer_only
FileSystem
{
Save it.
Line translation
name "MySPmod" = needed to tell to the game engine the names of the chapters inside the <New Game> menu
game "MySPmod" = it tells Steam to display the name of your mod in the <Play Games> menu window:

= and also it tells the engine to display the name of your mod on the taskbar when running:
<-- you have noticed a custom icon beside our mod title. Well, it's very easy to add even your custom icon to your mod. Just make yourself an icon (Icon WorkShop), and copy it into the <....\MySPmod\resource> folder, and rename it <game.ico>. title "P I T U L O N" = will tell the game engine to change the default Half-Life2 title with our custom one.
(in the <ClientScheme.res> file under <....\MySPmod\resource> folder, at the line ClientTitleFont you can change the tall, weight, antialiasing values)
title2 "No 1" = it lets you add a subtitle to your main Game Title (thanx to imatard from HL2 Coding forum)
That’s enough for the game engine to change the Game Title and to change the title’s font.
I’ve tested all this, but in a few tutorials I found that is necessary to change also some other lines from other files. For example:
In the <....\MySPmod\scripts> folder, open the file <gameinfo.txt> and you will find:
// Valve Game Info file
// These are key/value pairs. Certain mods will use different settings.
//
GameInfo
{
game "HALF-LIFE 2"
title "HALF-LIFE'"
type singleplayer_only
}
- now replace the lines with:
GameInfo
{
game "MySPmod"
title "MySPmod"
type singleplayer_only
}
Save it. (nothing will change this
- and also in the <....\MySPmod\scripts> folder, open the file <liblist.gam> (use Notepad to edit) and you will find:
// Valve Game Info file
// These are key/value pairs. Certain mods will use different settings.
//
game "Half-Life 2"
startmap "Hyper_001"
trainingmap "t0a0"
hlversion "1000"
mpentity "info_player_deathmatch"
- now replace the lines with:
game "MySPmod"
startmap "my_single-player_level"
trainingmap ""
hlversion "1000"
mpentity "info_player_deathmatch"
Save it. (nothing will happen again
So what we did is to edit files for nothing. The last 2 steps are worthless, and worth editing the files just to be correct and have our mod title everywhere.
8. At the chapter 4, at the 3rd line, we said something about a <StartupVids.txt> file. Well, this file will tell the game engine to load a INTRO-VIDEO at the beginning, replacing the default video from VALVe.
1st you should have created a custom video, with whatever you want to show up in it (must be a .AVI format). Name it <my_video.avi> for example. Remember to put it into <....\MySPmod\media> folder.
2nd let’s open the <StartupVids.txt> file that we created into the <....\MySPmod\media> folder and add this line:
media/my_video.avi
Save it.
• Now we’ll start the final phase of our tutorial: Setting-up the levels to start from the <New Game> menu.
9. Let’s get busy!
1st lets tell our Source engine to load our custom levels from the <New Game> menu, so when you press on the level’s chapter button the level will load.
In the <....\MySPmod\cfg> folder, open the newly created <chapter1.cfg> file (we created it on the 4th step). Into the blank text add the following line:
map my_single-player_level_chapter1
Save it.
(my_single-player_level_chapter1 being the name of your .BSP that you want to start first (like a chapter, in case you have sub-levels for that chapter)
In case you have multiple chapters (in my example, 3), you must do the same thing for the other two.
- open <chapter2.cfg> file and edit the line : map my_single-player_level_chapter2
- open <chapter3.cfg> file and edit the line : map my_single-player_level_chapter3
- …….. till chapter 213

2nd step is to add a chapter title that will appear into the <New Game> menu window.
Go in <....\MySPmod\resource> folder and there you will find the <hl2_english.txt> file. Rename it to <MySPmod_english.txt>. Open it. You will find a lot of lines there, select all and delete them! In the new blank text file add the following strings:
"lang"
{
"Language" "English"
"Tokens"
{
"MySPmod_Chapter1_Title" "MySPmod Chapter 1"
"MySPmod_Chapter2_Title" "MySPmod Chapter 2"
"MySPmod_Chapter3_Title" "MySPmod Chapter 3"
}
}
Save it.
In this way we have inside the <New Game> window this 3 chapters listed, so you can start the chapters individually, as in Half-Life2 <New Game> window.
3rd step is to create the small thumbnail picture that’s characterizing for each one of your chapters. The easiest way is to edit one of the existing thumb picture from one of the Half-Life2 chapters:

the image is 256x128 pixels (so you can edit even this one in Photoshop® because it’s the correct size)
After you made your modifications on each chapter's thumb picture, save them in the .VTF format and place them in the <....\MySPmod\materials\VGUI\chapters> folder that we created when we started.
You should have 3 .VTF files:

It should look like this after all the editing:

OK. So far we did:
1. Steam copied our mod into the \SourceMods folder.
2. We deleted\created a few folders and files.
3. We put our .BSP file into \maps folder
4. We created a static background.
5. We changed the Game Title with a new one and using a custom font.
6. We created our own intro-video and told the engine to display it.
7. We made our levels to start from <New Game> menu and we added for each chapter a title and a thumb picture.
Well, my friends, that’s all about the fast customization of your Half-Life2 single-player mod.
For any questions or bugs please e-mail me at: c_petrut@yahoo.com
::credits::
69th Vlatitude
VERC Collective
HL2Coding.com
SourceWiki
Half-Life 2 Database
HL2 Mod Central
SDK Docs - Valve Developer Community
Wavelength | Your Game Editing Resource |
::thanx to::
mastakilla47@gmail.com
imatard @ HL2 Coding :: Forum
dak @ HL2 Coding :: Forum
Mr. Greenfish
by Pitulon
©2005

















