-------------------------------------------------------------------------------- VN script format specification -------------------------------------------------------------------------------- Shiz 0. Purpose ---------- This specification describes a specification for an unnamed scripting format to be used for writing a visual novel (VN), according to the author's views of how such a format should look like. The aim is for this scripting format to feel natural and intuitive. This specification can both be used by complying VN Engines as a reference specification for parsing this format and by VN Script authors as a reference specification for writing complying VN Scripts. 1. Definitions -------------- VN Engine: an interpreter that can parse correctly VN Scripts that comply to this specification. VN Script: a text file containing commands that can be successfully interpreted by a complying VN Engine, following this specification. Statement: a single command in a VN Script. Dialogue Statement: a kind of statement that indicates textual dialogue in the VN Script. Choice Statement: a kind of statements that indicates a branching point in the VN Script with one or more Choices. Engine Command Statement: a kind of statement that indicates a call to the VN Engine API. Native Code Statement: a kind of statement that indicates a script in the engine's native coding language, for additional functionality. Engine Command Delimiter: the delimiter character(s) used to begin and/or end an Engine Command. Currently defined as either '{' (Unicode character #123) or '}' (Unicode character #125), but not both. Native Code Delimiter: the delimiter character(s) used to begin/or and end a Native Code statement. Definition in development. 2. Layout and Encoding ---------------------- A VN Script consists of zero or more Statements. Statements shall be terminated by a newline (CR-LF). A VN Script should be encoded in the UTF-8 encoding format. A Byte Order Mark (BOM) is optional, but not required. 3. Statements ------------- A Statement can be of any of the three following types: a. Dialogue Dialogue Statements shall be written bare, without delimiters or escapers necessary. Dialogue Statements can be broken down into two components: 1. The Actor, which represents the person the dialogue belongs to. 2. The Text, which represents the contents of the dialogue. Dialogue Statements can take any of the three following forms: 1. This is a simple dialogue line. 2. Actor: This is a simple dialogue line. 3. : This is a simple dialogue line. In the first case no Actor is specified and the special Narrator Actor shall be used as the Actor. In the second case an Actor (conveniently named Actor) is specified which shall be used. In the third case no Actor is specified, but a colon is inserted. This means the last-used Actor shall be used as the Actor for this statement. In case of no last-used Actor, the special Narrator actor shall be used. Text can optionally contain inline Engine Command Statements. This is done by simply inserting the Statement mid-Text with its regular Engine Command Delimiters. This has as a result that the Engine Command Delimiters are reserved for use in Text statements. To use these Delimiters literally, one must escape them by duplicating the delimiter character. For instance, if one would normally write Foo { bar }. , then in order to prevent the insertion of an inline Engine Command Statement one would have to write Foo {{ bar }}. instead. b. Choice c. Engine Command d. Native Code 4. Base VN Engine API ---------------------