To what style do you want to make it?

 KAG divides the text-based adventure game world into 2 types: to display the message frame(ADV) and to display the text on the entire screen roughly(NVL). It is good at either method because it seems that there's no great difference, except for only in the display place of the text.

UsingVN.jpgUsingFrame.jpg
Two methods

 Moreover, Vertical writing can also be done.

Vertical.jpg
Vertically-written text display

 Horizontal text is displayed by default. Please refer to Config.tjs for details. It pursues the Horizontal text subject in this tutorial in more detail.

I want to display something!

 Then, let's display something as an experiment. There is a file named first.ks in the Scenario folder. This is the first file that Kirikiri reads and interprets to display or analyse something.
 This is the file's standard content:

[wait time=200]
*start|Start
[cm]
Hello.
*Original code is also translated for understanding... You can compare the original script file and translated text to understand...

 Please pay attention only to the line written, 「Hello.」 though it is a bit embarrassing because it writes something stupid suddenly on your game screen. Instead of this "Hello", please write text, which you want to display, in the editor.
 For instance, write "Good evening". Then Kirikiri is started and the dialog box of folder/archive selection opens. Browse to your Project folder, that you just created, and press the OK button. You have to specify the Project folder, NOT first.ks.


kon-banwa.png
「Hello.」

  Then, "Good Evening" is displayed on a jet-black screen. Let's display the Background explains how to add a visual backdrop on your black scene.
 Anyways, it is possible to write any text, instead of 「Hello.」 in this way.

Let's use the New Line and click waiting.

 Now, let's wait for the click at the end of the line. To do the click waiting, [l] is written in the part where you want to do the click waiting.([l] is normal-width; l is L of the small letter.)
 After that, [r] is written to make the game change line with it.


[wait time=200]
*start|Start
[cm]
Hello.[l][r]
Cheerful Yoroshuu[l][r]

 Please end once, start, and execute the project folder using Kirikiri.


gokigen.png
Click waiting


 Game will wait for mouse click(or Return key) to change line after "Hello". Then, a new line is displayed, "Cheerful Yoroshuu".

Let's use the page break waiting

 When all characters are deleted and it wants to begin to display the characters from the left, it is written in a new line as [cm] ([cm] is normal-width and single-byte)
 However, if the click waiting is not done ahead of that, the screen is erased without permission. Usually, in front of [cm], [p] is written. Please look at the following examples:

[wait time=200]
*start|Start
[cm]
Hello. [l][r]
Cheerful Yoroshuu[l][r]
Page Changes...[p]
[cm]
Page Changed.

 Well, please try executing this piece of code. A Click Waiting symbol indicating the page break at the position of the [p] appeared. When clicked, it deletes all the text and displays "Page Changed." from the new page's top-left side.


Note
 Tag that deletes the message are three: 'er', 'ct', and 'cm'. Because operation is slightly different, this explains ( → Using the Save & Load feature ) the saving and loading feature. You might use unified 'cm' as long as it doesn't do anything special.



Note
 In the tutorials for previous versions of KAG, [ct] was used. [ct], much like [cm], clears all the text, but doesn't return back to the screen message layer to work on. So, [cm] usability is better than [ct].
 However, immediately after a save label described below, remember to write [cm] or the [ct] tag.


 In KAG, all the text is written on the 「Message Layer」. As Standard, there is another message layer, and if two are used properly, the conversation scene of two people can be easily expressed in KAG. Please refer to the current tag for details.

What are Tags?

 Till now, we have used the enclosing square brackets []...
 ...and the letters enclosed in these square brackets [] are called Tags, and one of the many commands to control KAG in various ways.
 For example, in the first line of code, [wait time=200] is a tag with the tag name of wait which is accompanied by time=200 attribute. time is the attribute name which has 200 as it's value.
 Tag are written in square brackets [ with the 「tag names」 in the opening and then a space and 「Attribute = Value of Attribute」 written. 「Attributes = Value of Attributes」 can also be written in a single line, if there are multiple attributes. This square bracket ] ends the tag command.
 There are various tags, and you can grip the sense of all these tags sooner or later if you learn by writing and imitating these various tag codes.
 Tags are important in various ways. All the instructions of non-character display to KAG are done with this tag. There are a lot of tags, so please refer to the Tag reference for easy understanding.

 New tag can be defined by combining existing tags using the macro ( → Using Macros ). Because the custom tag is made by you, it is convenient and very useful. It is very easy to put it together in the game system, and to define the set of tags in the macro beforehand.


Note
 In KAG previous versions, as long as you do not write a \(backslash) at the end of the line, the line is broken into new line. In KAG 3 or later, it won't break into a new line as long as you do not write a [r]. If you want the same treatment like in previous KAG versions, please specify 'global.ignoreCR' to 'false' of Config.tjs.


Command line

 The line that has @ at the beginning is recognized as the "Command line".
 The tag surrounded by [ and ], that is, the command(if any) is @ followed by the tag name and the attribute. Only one command(but many attributes) can be written in one line.
 Only the type of writing is different, but it behaves like a normal tag.

 For example, the following two lines have the same meaning:


[wc time=20]
@wc time=20


 Moreover, the example of "Page break waiting" can be rewritten as follows.


@wait time=200
*start|Start
@cm
Hello. [l][r]
Cheerful Yoroshuu [l][r]
Page Changes...[p]
@cm
Page Changed.

Special symbols and special line in scenario

 In a plain text file, it is necessary to note that the following symbols can be used for special purposes(commands):

  []  (Square Brackets)
     This symbol indicates the beginning of a tag(see above).
     If you want to absolutely use the single-byte brackets as the beginning, rather than as the beginning of the tag, write two consequtive brackets [[ (Closing square brackets are OK if you write normally).
  ;  (Semicolon)
     The Semicolon comes at the beginning of the line, which you want to be ignored by Kirikiri. In other words, you can use it to write comments.
  *  (Asterisk)
     Written only in the beginning of line, this defines the label, which can be used as a target when the scene is called(linked). It also marks the Saving and Loading place.
  @  (At-the-Rate sign)
     Written only in the beginning of line, this defines the command line.
  Tab
     The tab at the beginning of a line is disregarded completely(ignored). The scenario file is written by using this Tab and the indentation(Indentation is done for clarity). It is necessary to note it because the blank spaces are not ignored, whereas tabs are ignored.