Talk:Subtitles (Portal 2): Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
 (Created page with "== Example == I wanted GLaDOS to speak when I pressed a button  I have my captions inside a file called ''closedcaption_mymod_English.txt'' which is in the format: <source lang=p...")  | 
				mNo edit summary  | 
				||
| Line 2: | Line 2: | ||
I wanted GLaDOS to speak when I pressed a button  | I wanted GLaDOS to speak when I pressed a button  | ||
I have my captions inside a file called ''  | I have my captions inside a file called ''closecaption_mymod_English.txt'' which is in the format:  | ||
<source lang=php>  | <source lang=php>  | ||
lang  | lang  | ||
| Line 17: | Line 17: | ||
I open up the cmd prompt and put in:    | I open up the cmd prompt and put in:    | ||
<source>  | <source>  | ||
"U:/Program Files/Steam/steamapps/common/Portal 2/bin/captioncompiler.exe" -v "  | "U:/Program Files/Steam/steamapps/common/Portal 2/bin/captioncompiler.exe" -v "closecaption_mymod_English.txt"  | ||
</source>  | </source>  | ||
Revision as of 06:59, 30 April 2012
Example
I wanted GLaDOS to speak when I pressed a button
I have my captions inside a file called closecaption_mymod_English.txt which is in the format:
lang
{ 
	Language "English"
	Tokens 
	{ 
		GLaDOS.ramble1	"Sorry about the mess. I've really let the place go since you killed me."
		GLaDOS.ramble2	"By the way, thanks for that."
	}
}
I open up the cmd prompt and put in:
"U:/Program Files/Steam/steamapps/common/Portal 2/bin/captioncompiler.exe" -v "closecaption_mymod_English.txt"In Hammer I create an ambient_generic which points towards my custom GLaDOS sound and named it: glados_ramble1. I also add a point_servercommand and name it @servercommand. Inside a newly created logic_auto I put:
| My Output | Target | Target Input | Parameter | 
|---|---|---|---|
| OnMapSpawn | @servercommand | Command | cc_lang mymod_English | 
I create a prop_button and add another output:
| My Output | Target | Target Input | Parameter | 
|---|---|---|---|
| OnPressed | @servercommand | Command | cc_emit GLaDOS.ramble1 | 
Also in the prop_button I add another output to activate the sound:
| My Output | Target | Target Input | Parameter | 
|---|---|---|---|
| OnPressed | glados_ramble1 | PlaySound | 
Tada! The captions appear with the sound.
--Chickenmobile 00:20, 1 March 2012 (PST)