Ru/Subtitles (Portal 2): Difference between revisions
No edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
|en=Subtitles (Portal 2) | |en=Subtitles (Portal 2) | ||
}} | }} | ||
В основном [[Closed Captions|надписи и субтитры]] используются для отображения реплик и диалогов персонажей для игроков с нарушениями слуха, или если отсутствует звук. В субтитрах также можно отражать простые звуки игрового мира, например, взрывы или открытие дверей. Субтитры считаются важным компонентом, когда дело доходит до средних и больших модификаций, так как модификация будет доступна гораздо более широкой аудитории, чем одна карта. | |||
Субтитры также служат временными заменителями диалогов, которые ещё не записаны, поскольку при производстве уровня запись диалогов может занять очень много времени. | |||
[[ | В Portal 2 появляются автоматически, когда персонаж начинает говорить (если так определено в специальном файле [[Logic choreographed scene|сцен]]), однако, можно создавать собственные файлы сцен без необходимости перекомпилирования всего файла scenes.image. Здесь необходим обходной путь. | ||
{{Note:ru|This tutorial will assume that you already have your (custom) sound implemented in your map and will use the name of the examples for consistency.}} | |||
== Создание файла субтитров == | |||
== | |||
Firstly, create the captions inside a text file located in the ''Steam/steamapps/common/Portal 2/portal2/resource'' folder. The format of the captions should look like this: | Firstly, create the captions inside a text file located in the ''Steam/steamapps/common/Portal 2/portal2/resource'' folder. The format of the captions should look like this: | ||
Line 22: | Line 18: | ||
lang | lang | ||
{ | { | ||
Language " | Language "Russian" | ||
Tokens | Tokens | ||
{ | { | ||
character.example1 " | character.example1 "Это образец субтитров." | ||
character.example2 " | character.example2 "Вы должны видеть надписи на экране." | ||
} | } | ||
} | } | ||
Line 32: | Line 28: | ||
* | * Сохраните файл .txt в кодировке ''UCS-2 Little Endian'' или ''UTF-16 LE''. Для этого воспользуйтесь Notepad++ или другим продвинутым текстовым редактором. | ||
* | * Текст субтитров должен быть заключён в кавычки. | ||
* | * Именем субтитра должно быть именем [[soundscript]], а не именем звука. Однако, субтитры работают и без создания soundscript. | ||
* | * Сохраните файл .txt с префиксом ''closecaption_''в имени. | ||
== | == Компиляция файла .txt в файл .dat == | ||
In order for the captions to be able to be seen in game, the captions must be compiled into a .dat file. This can be done using the ''captioncompiler'' executable located inside the ''Portal 2/bin'' file. | In order for the captions to be able to be seen in game, the captions must be compiled into a .dat file. This can be done using the ''captioncompiler'' executable located inside the ''Portal 2/bin'' file. | ||
Line 52: | Line 48: | ||
{{note|If the file refuses to compile because the [[What is meant by Game Directory?|Game Directory]] is different from the portal 2 folder, change it by making a duplicate entry in the gameConfig.txt in your SouceSDK/bin/ep1(orangebox)/bin folder with the paths of the "GameDir" value leading to your ''Portal 2/portal2'' directory. Then run SourceSDK with the custom parameters to make Portal 2 the active mod.}} | {{note:ru|If the file refuses to compile because the [[What is meant by Game Directory?|Game Directory]] is different from the portal 2 folder, change it by making a duplicate entry in the gameConfig.txt in your SouceSDK/bin/ep1(orangebox)/bin folder with the paths of the "GameDir" value leading to your ''Portal 2/portal2'' directory. Then run SourceSDK with the custom parameters to make Portal 2 the active mod.}} | ||
{{note|Workaround: Navigate to \Steam\SteamApps\common\portal 2\bin, create a new folder and name it "resource". Save our closecaption_NameOfFile.txt in this new folder. Navigate to \Steam\SteamApps\common\portal 2\portal2 and copy the file gameinfo.txt you find here into \Steam\SteamApps\common\portal 2\bin. When running captioncompiler.exe, it will save the compiled .dat-file into \Steam\SteamApps\common\portal 2\bin\resource. Grab the .txt and the .dat file from there and move them into \Steam\SteamApps\common\portal 2\portal2\resource.}} | {{note:ru|Workaround: Navigate to \Steam\SteamApps\common\portal 2\bin, create a new folder and name it "resource". Save our closecaption_NameOfFile.txt in this new folder. Navigate to \Steam\SteamApps\common\portal 2\portal2 and copy the file gameinfo.txt you find here into \Steam\SteamApps\common\portal 2\bin. When running captioncompiler.exe, it will save the compiled .dat-file into \Steam\SteamApps\common\portal 2\bin\resource. Grab the .txt and the .dat file from there and move them into \Steam\SteamApps\common\portal 2\portal2\resource.}} | ||
== Making the captions appear in game == | == Making the captions appear in game == | ||
Line 88: | Line 84: | ||
{{Note|Do not use the prefix closecaption_ when calling the file like this. When using the command cc_lang, the game automatically adds that prefix, so you would end up calling closecaption_closecapion_NameOfFile. Please visit the [[Talk:Subtitles (Portal 2) |discussion section]] of this page for an example.}} | {{Note:ru|Do not use the prefix closecaption_ when calling the file like this. When using the command cc_lang, the game automatically adds that prefix, so you would end up calling closecaption_closecapion_NameOfFile. Please visit the [[Talk:Subtitles (Portal 2) |discussion section]] of this page for an example.}} | ||
Line 142: | Line 138: | ||
</source> | </source> | ||
== | == См. также == | ||
*{{en}} [[Closed Captions|Субтитры]] | *{{en}} [[Closed Captions|Субтитры]] | ||
[[Category:Portal 2 Level Design:ru]] | [[Category:Portal 2 Level Design:ru]] | ||
[[Category:Portal 2 Tutorials:ru]] | [[Category:Portal 2 Tutorials:ru]] |
Revision as of 03:00, 14 January 2014
Template:Otherlang2 В основном надписи и субтитры используются для отображения реплик и диалогов персонажей для игроков с нарушениями слуха, или если отсутствует звук. В субтитрах также можно отражать простые звуки игрового мира, например, взрывы или открытие дверей. Субтитры считаются важным компонентом, когда дело доходит до средних и больших модификаций, так как модификация будет доступна гораздо более широкой аудитории, чем одна карта.
Субтитры также служат временными заменителями диалогов, которые ещё не записаны, поскольку при производстве уровня запись диалогов может занять очень много времени.
В Portal 2 появляются автоматически, когда персонаж начинает говорить (если так определено в специальном файле сцен), однако, можно создавать собственные файлы сцен без необходимости перекомпилирования всего файла scenes.image. Здесь необходим обходной путь.
Создание файла субтитров
Firstly, create the captions inside a text file located in the Steam/steamapps/common/Portal 2/portal2/resource folder. The format of the captions should look like this:
lang
{
Language "Russian"
Tokens
{
character.example1 "Это образец субтитров."
character.example2 "Вы должны видеть надписи на экране."
}
}
- Сохраните файл .txt в кодировке UCS-2 Little Endian или UTF-16 LE. Для этого воспользуйтесь Notepad++ или другим продвинутым текстовым редактором.
- Текст субтитров должен быть заключён в кавычки.
- Именем субтитра должно быть именем soundscript, а не именем звука. Однако, субтитры работают и без создания soundscript.
- Сохраните файл .txt с префиксом closecaption_в имени.
Компиляция файла .txt в файл .dat
In order for the captions to be able to be seen in game, the captions must be compiled into a .dat file. This can be done using the captioncompiler executable located inside the Portal 2/bin file.
Go to Start -> Run and type in cmd to bring up the command prompt. Navigate to the captioncompiler.exe file and drag it into the command prompt. Then use the input -v "closedaption_NameOfFile.txt" after it. Like so:
"U:/Program Files/Steam/steamapps/common/Portal 2/bin/captioncompiler.exe" -v "closecaption_NameOfFile.txt"
This will compile the captions into the file which can run in game. Keep the compiled file inside the resource folder.
Making the captions appear in game
Since making scenes are out of the option for making the captions appear, it is necessary to manually make the captions appear using entities inside the hammer editor or using a script.
- Create or use a point_servercommand.
- Create a logic_auto and put the output with the name of the caption file without the prefix closecaption_:
My Output | Target | Target Input | Parameter |
---|---|---|---|
OnMapSpawn | @servercommand | Command | cc_lang NameOfFile |
3. Using whichever method to activate the sound or caption add these outputs:
My Output | Target | Target Input | Parameter |
---|---|---|---|
OnAnOutput | @servercommand | Command | cc_emit character.example1 |
- Make sure to also activate the preferred sound at the same time. (This was the whole reason for the captions).
If you use original scene files in your map but only have a few custom voice lines, you shouldn't change the cc_lang OnMapSpawn, as people will not see the subtitles for the original scenes this way. Instead, activate your custom subtitles file only when needed. Like so:
My Output | Target | Target Input | Parameter | Delay |
---|---|---|---|---|
OnAnOutput | @servercommand | Command | cc_lang NameOfFile | 0.00 |
OnAnOutput | @servercommand | Command | cc_emit character.example1 | 0.10 |
OnAnOutput | @servercommand | Command | cc_lang | 0.20 |
Using the command cc_lang without defining which one in the final Output will make the game use the language of the Game_UI again, while still playing the custom subtitles activated 0.1 seconds earlier.
Caption Codes (Portal 2)
<sfx>
- Marks a line as a sound effect that will only be displayed with full closed captioning. If the user has cc_subtitles set to "1", it will not display these lines.
<clr:255,255,255>
- Sets the color of the caption using RGB color; 0 is no color, 255 is full color. For example, ;
<clr:255,0,0>
would be red. <b>
- Bolds all text following the tag.
<i>
- Italics text following the tag.
<len:#>
- Indicates how long the caption should appear on the screen.
<norepeat:#>
- Sets how long until the caption can appear again. Useful for frequent sounds.
An example of how to use a code tag:
lang
{
Language "English"
Tokens
{
character.example1 "<clr:255,0,0><b> Character: This is an example caption."
character.example2 "<clr:255,0,0><len:3> Character: You should be able to see captions on the screen."
}
}