Fate/stay night:Text import

From Baka-Tsuki
Revision as of 20:09, 8 May 2008 by Const2k (talk | contribs) (temporary save, TL in progress)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.KS file format

Game stores its dialogue texts in *.ks files which have the following structure:

@script
@script
@texton
text [l][r]
text [l][r]
...
text
@pg
*page n|
@textoff

The text to be translated is located between @texton and @textoff marks. System marks @pg, [l][r] and *page n| should be left untouched, as they are.

Word wrap

Introduction

One of the popular engines that are used in creation of visual novels is kirikiri. It doesn't support automatic word wrapping, since it was written by Japanese programmer, and solely for Japanese language (that doesn't have word wraps at all). Because of this feature of kirikiri2 (version used in creation of Fate/stay night), the text "It was a thrust like lightning. A spearhead thrust to pierce my heart. Trying to dodge it would be useless. Being lightning, it's invisible to the human eye." would be shown this way:

It was a thrust like lightning. A spe
arhead thrust to pierce my heart. Try
ing to dodge it would be useless. Bei
ng lightning, it's invisible to the h
uman eye.

To be able to use word wrap in game, one must explicitly state them. For example, the following markup:

[wrap text="It"]It [wrap text="was"]was a [wrap text="thrust"]thrust [wrap text="like"]like
[wrap text="lightning."]lightning. A [wrap text="spearhead"]spearhead [wrap text="thrust"]thrust
[wrap text="to"]to [wrap text="pierce"]pierce [wrap text="my"]my [wrap text="heart."]heart.
[wrap text="Trying"]Trying [wrap text="to"]to [wrap text="dodge"]dodge [wrap text="it"]it
[wrap text="would"]would [wrap text="be"]be [wrap text="useless."]useless. [wrap text="Being"]Being
[wrap text="lightning,"]lightning, [wrap text="it's"]it's [wrap text="invisible"]invisible
[wrap text="to"]to [wrap text="the"]the [wrap text="human"]human [wrap text="eye."]eye.

...will lead to text above being shown this way:

It was a thrust like lightning. A
spearhead thrust to pierce my heart.
Trying to dodge it would be useless.
Being lightning, it's invisible to
the human eye.

An end-of-line, if needed, is marked by symbols [l][r]:

[wrap text="It"]It [wrap text="was"]was a [wrap text="thrust"]thrust [wrap text="like"]like
[wrap text="lightning."]lightning.[l][r] A [wrap text="spearhead"]spearhead [wrap text="thrust"]thrust
[wrap text="to"]to [wrap text="pierce"]pierce [wrap text="my"]my [wrap text="heart."]heart.[l][r]
[wrap text="Trying"]Trying [wrap text="to"]to [wrap text="dodge"]dodge [wrap text="it"]it
[wrap text="would"]would [wrap text="be"]be [wrap text="useless."]useless.[l][r] [wrap text="Being"]Being
[wrap text="lightning,"]lightning, [wrap text="it's"]it's [wrap text="invisible"]invisible
[wrap text="to"]to [wrap text="the"]the [wrap text="human"]human [wrap text="eye."]eye.[l][r]

Such markup will result in showing sentences on separate lines:

It was a thrust like lightning.
A spearhead thrust to pierce my heart.
Trying to dodge it would be useless.
Being lightning, it's invisible to
the human eye.

Editing

Since typing such syntax is time- and effort-consuming, it's better to use software to automatize this work. For example, one can use xp3-wordwrap.exe utility that's included in xp3tool package, intended to work with xp3-archives. To do this:

  • Create text file and paste text you want to be processed into it
  • Save it under Win-1251 codepage (ANSI encoding) with *.ks extension
  • Create batch (*.bat) file that has input and output file names, for example:
xp3-wordwrap.exe "H:\work.ks" "C:\Fate_src\complete.ks"
  • Move it to the folder where xp3-wordwrap.exe is in and run your batch file from there
  • To be able to work with newly created complete.ks, one should open it as Win-1251-encoded text (not as the default Unicode)
  • To make work easier, one can further process resulting file. If you use Akelpad (is bundled with Total Commander):

Edit -> Replace -> What:

. [wrap text="

-> With:

.[l][r] \n[wrap text="

-> Esc-sequence (check) -> Replace all.

  • This will allow you edit your script by substituting blocks of text.

Импорт

Для создания xp3-архивов можно воспользоваться утилитой xp3-repack.exe, также входящей в состав пакета xp3tool. Эта программа работает в командной строке, но при частой работе с архивами удобнее воспользоваться разработанными специально для неё оболочками (GUI, см.ниже).

Консоль

  • Создайте в катологе вместе с программой текстовик 123.bat.
  • Впишите в него слейдущий код:
xp3-repack.exe directory archive.xp3 fate_full

где вместо archive.xp3 и directory задаете. ваше имя архива и папку для распаковки.

  • Теперь запустите 123.bat через applocale.

Gui

  • После распаковки закиньте в папку c xp3tool программы-интрейсы.
  • Запускаем файл repacker.exe, в нем указываем имя соханяемого файла и католог со скриптами, нажимаем Go
  • Архив готов.