TF2/Modifying the Mission Briefing

From Valve Developer Community
< TF2
Revision as of 15:33, 23 July 2008 by A2h (talk | contribs)
Jump to navigation Jump to search
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

The mission briefing, shown to players before they enter the match, is set automatically for Basic Capture the Flag and Control Point games, just by putting the right goal entities on the map. Custom ones can be done, but how? It is not possible to do so via a tool such as Hammer, but you can edit the localized texts in the directory where you map is in.

Writing a briefing

In the directory where your .bsp is (_mapname_.bsp - Usually "..\Program Files\Valve\Steam\SteamApps\_Username_\Team Fortress 2\tf\maps\"), create the localised map .txt briefing files. You can also extract them from the TF2 .gcf with GCFScape and rename the for your map. So the maps directory should look like this:

  • mapname.bsp
  • mapname_danish.txt
  • mapname_dutch.txt
  • mapname_english.txt
  • mapname_finnish.txt
  • mapname_french.txt
  • mapname_german.txt
  • mapname_italian.txt
  • mapname_japanese.txt
  • mapname_korian.txt
  • mapname_norwegian.txt
  • mapname_polish.txt
  • mapname_portuguese.txt
  • mapname_russian.txt
  • mapname_schinese.txt
  • mapname_swedish.txt
  • mapname_tchinese.txt

For cp_dustbowl, replace mapname with cp_dustbowl.

In each of those, is the briefing text displayed for your map, in the named language.

Adding Custom Map Images

In order for your custom map to have 2 working Menu Photos it needs 2 files in following directory:
C:\Program Files\Steam\steamapps\<account_name>\team fortress 2\tf\materials\vgui\maps

These 2 files are:

  • menu_photos_mapname.vtf
  • menu_photos_mapname.vmt

Creating the VTF file

Making a TGA image

  1. Take a few screenshots of your map depending on how many you want to show. Make sure they look good in a 512x512 resolution.
  2. Create a 512x512 pixels TGA with a black blackground, then paste your screenshots into it. Edit the alpha channel of the image so it hides the black background. Note that you will require an advanced image editor to do this, such as Adobe Photoshop. Save the file as menu_photos_mapname.tga in 32 bit and uncompressed.
  3. Copy and paste your "menu_photos_mapname.tga" in following directory: C:\Program Files\Steam\steamapps\<account_name>\team fortress 2\tf\materialsrc

Preparing VTEX

We will create a vtf from the tga using vtex.exe. Let's take some time to set it up.

  1. Go to the following directory and create a desktop shortcut of the vtex.exe: C:\Program Files\Steam\steamapps\<account_name>\sourcesdk\bin\orangebox\bin
  2. Go Properties on the vtex.exe shortcut and append the following parameters to the text in the Target field:
-game "C:\Program Files\Steam\steamapps\<account_name>\team fortress 2\tf"  -nop4


Converting the TGA to VTF

Drag your tga you created onto the vtex.exe desktop shortcut. The vtex.exe will create a menu_photos_mapname.vtf in the following directory: C:\Program Files\Steam\steamapps\<account_name>\team fortress 2\tf\materials


Creating the VMT file

Open notepad and paste the following lines of code into it.

"UnlitGeneric"
{
 "$basetexture" "vgui\maps\menu_photos_mapname"
 "$translucent" 1
 "$ignorez" 1
 "$vertexcolor" 1
} 

Replace 'mapname' in "$basetexture" "vgui\maps\menu_photos_mapname" with the name of your custom map. For example, if your map is called ctf_2fort, then it should read

"$basetexture" "vgui\maps\menu_photos_ctf_2fort"

Save the file as "menu_photos_mapname.vmt".

Place your files in the proper directory

Move your "menu_photos_mapname.vtf" and "menu_photos_mapname.vmt" to the following directory:

C:\Program Files\Steam\steamapps\<account_name>\team fortress 2\tf\materials\vgui\maps

If you correctly edited the Alpha Channel of your tga and did all the other steps like mentioned, your 2 map screens will be displayed on the Objective Screen on Map Start!


Conclusion

It is advised to pack the files into your map using BSPZip, PakRat or a similar program, otherwise, your files won't be downloaded while connecting to a server running the map, hence your briefing will not appear on other clients.