Custom Menu

Tutorial collection, comprehensive listings on main site.

Custom Menu

Postby Tutorial on Wed Mar 16, 2005 12:44 am

category
Miscellaneous

description
Add your very own backgrounds into your modification.

keywords
custom, menu, mod, titles, title, mods.

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:
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
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby dschaub on Wed Mar 16, 2005 2:44 pm

I notice you changed the color of the menu options (such as "New Game", "Load Game", etc.) on your custom menu. How did you do that? Oh, and as far as the background image having to have dimensions that are powers of two, it's because it is stored as a .vtf, and all vtf's need to have dimensions that are powers of two.
Mini Wars Project Lead
dschaub
Dumpling
Dumpling
 
Joined: Wed Mar 16, 2005 2:40 pm

Postby mr greenfish on Wed Mar 16, 2005 11:17 pm

the colours are stated in the file resource/sourcescheme.res

the colours needs to be defined here:
Colors
{
// base colors
"White" "255 255 255 255"
"OffWhite" "216 216 216 255"
"DullWhite" "142 142 142 255"
"grey" "80 80 80 255"
"TransparentBlack" "0 0 0 128"
"Black" "0 0 0 255"
"Blank" "0 0 0 0"
}

Simply add your own, and choose the colour with RGB values (the right column) the last three digits I believe is the render amount, if you put 255 its will be solid, or the lower the number the more transparent it will be.

anyway, once you define your new colour there you need to reference it lower in that file e.g.

MainMenu.TextColor "grey"

in the above example you'd replace 'grey' with whatever the colour is that you just added.

---

If you want to change the colour of the actual title itself, you need to look in resource/clientscheme.res

in particular:

"Main.Title1.Color" "0 0 0 255"

NOTE: You can also move the buttons etc. around in this file, for example you want to move them more to the left as i did in the tutorial.

hope that helps

-Mr Greenfish
Image Available now
User avatar
mr greenfish
1337 p0st3r
1337 p0st3r
 
Joined: Sat Dec 04, 2004 12:05 pm

Postby dschaub on Thu Mar 17, 2005 4:24 pm

Thanks for the help, I figured it'd be in that file somewhere, but I wasn't sure what it would be called. Excellent tutorial btw.
Mini Wars Project Lead
dschaub
Dumpling
Dumpling
 
Joined: Wed Mar 16, 2005 2:40 pm

Postby ska-diesel on Tue Mar 22, 2005 9:23 pm

Im a complete novice so please bear with me...

Ive started a new mod, using Steam/utilities/create new mod etc, so I just have a couple of questions...

1- Where do I get the program to convert TGAs to vtf files?
2- Do I need to put the vtf into a packfile... or just a folder...

Any help would be great :-)
User avatar
ska-diesel
Just Joined
Just Joined
 
Joined: Tue Mar 22, 2005 8:55 pm

Postby Cr4ig on Tue Mar 22, 2005 10:05 pm

Welcome to the forums. this might help: http://forum.interlopers.net/viewtopic.php?t=1826
Image
Cr4ig
Senior Member
Senior Member
 
Joined: Mon Nov 08, 2004 10:55 pm

Postby Shifty155 on Fri Mar 25, 2005 2:52 am

Where is the clientscheme.res? (it is not in resource/whatever)
Image
Shifty155
Pheropod
Pheropod
 
Joined: Sat Feb 12, 2005 4:13 pm
Location: nomoreroominhell.com

Postby mr greenfish on Mon Mar 28, 2005 11:25 pm

if it isnt in your mod folder, extract the file from the source engine.gcf file
(you can use GCFScape for this, http://nemesis.thewavelength.net/index.php?p=26 )

Make sure though that once extracted you do place it in your mods resource folder
Image Available now
User avatar
mr greenfish
1337 p0st3r
1337 p0st3r
 
Joined: Sat Dec 04, 2004 12:05 pm

Postby Buxy on Sat Apr 30, 2005 4:16 am

im new to this forum, so i'd like to start off by saying Hi to the MOD community. ... and now i shall get to my point :

When i run my game i dont have a title, even when i didnt do this tutorial it didnt say HALF-LIFE2 like it should. o thought i'd try doing this tutorial and it still might work but alas nothing shows.

Any Ideas ?

thank you in advance
Buxy
Just Joined
Just Joined
 
Joined: Sat Apr 30, 2005 4:13 am

Postby SyntaX.ErroR on Tue May 17, 2005 4:33 pm

Hey there!

I want to make a moving background for my SP mod? How to do this? :S
SyntaX.ErroR
Member
Member
 
Joined: Tue May 17, 2005 4:32 pm

Postby Cr4ig on Tue May 17, 2005 4:40 pm

Image
Cr4ig
Senior Member
Senior Member
 
Joined: Mon Nov 08, 2004 10:55 pm

Postby SyntaX.ErroR on Tue May 17, 2005 5:15 pm

Do u have to compile the edits? If yes, how?
SyntaX.ErroR
Member
Member
 
Joined: Tue May 17, 2005 4:32 pm

Postby Ophidian on Tue May 31, 2005 4:30 am

Buxy wrote:im new to this forum, so i'd like to start off by saying Hi to the MOD community. ... and now i shall get to my point :

When i run my game i dont have a title, even when i didnt do this tutorial it didnt say HALF-LIFE2 like it should. o thought i'd try doing this tutorial and it still might work but alas nothing shows.

Any Ideas ?

thank you in advance


Same here, I don't have a damned title. Just a menu, but no fricken title. I've edited those damn res files, that damned gameinfo file, and looked around in other files about 298624906240asdha times. And believe me, that's a lot. You don't even want me to pronounce that number.

*EDIT*

I fixed it.

For some faggot ass reason, I had two gameinfo.txt's. One was in /scripts, the other was in the root directory of my mod. I renamed the one in /scripts to _gameinfo.txt just to check, copied all the stuff that looked important from that one into the gameinfo.txt in the root directory, and voila, everything is peachy keen. I win.
Ophidian
1337 p0st3r
1337 p0st3r
 
Joined: Sat Feb 12, 2005 10:18 pm
Location: In Your Computer

Postby Torrean on Wed Jun 01, 2005 3:00 am

No matter what, there's a gameinfo.txt in both the root file and scripts file. It's on all mods. But, no matter what NO text appears on my menu. I've done EVERYTHING in the tut, and it still doesn't work. Any help?
User avatar
Torrean
Been Here A While
Been Here A While
 
Joined: Tue Mar 29, 2005 12:56 am
Location: In the Seeeealab (underneath the sea)

Postby Ophidian on Wed Jun 01, 2005 4:22 am

Yeah, let's make this easy to understand.

gameinfo.txt = a

scripts/gameinfo.txt = b

Take the stuff in b, that isn't in a, and put it in a. Rename b to _gameinfo.txt

Done.
Ophidian
1337 p0st3r
1337 p0st3r
 
Joined: Sat Feb 12, 2005 10:18 pm
Location: In Your Computer
Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users

cron