Closed Captions

From Valve Developer Community
Revision as of 20:25, 15 May 2006 by Giles (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Closed captions, or subtitles, are text descriptions that accompany sound and dialogue. Their primary use is to enhance accessibility for users with audio-related difficulties, be it a disability, a hardware problem, or simply noisy surroundings. They can be enabled in the Source engine in the Audio tab of the Options dialogue box.

Editing Closed Captions

Closed captions are stored in closecaption_%language%.txt, e.g. closecaption_english.txt in the resource folder of a mod. The caption files for Half-Life 2 can be found in source engine.gcf under root/hl2/resource. To expand or edit the HL2 captions, extract this file using GCFScape and edit it.

The format of the file is:

"lang"
{ 
"Language" "English" //(or "french", etc)
"Tokens" 
{ 

// Captions defined here.
"nameofcorrespondingsound"	"This is the caption."
"barn.chatter"	"We're picking up radio chatter. They're looking for your car. "
// ...

}
}

As indicated, the first half of a caption-defining line is the name of a sound token. This should correspond to a sound defined in one of the sound files listed in modname/scripts/game_sounds_manifest.txt. E.g. barn.chatter is defined in hl2/scripts/level_sounds_coast.txt.

Note:Be careful of which program you choose to edit this file with. Some text editors can change the formatting of the file, which will cause Source to reject the closed captions file and no closed captions will display. Notepad with word wrap turned off works fine. Others do not.

See Also