chooventerp/doc/story-format.md
2024-07-30 14:25:04 +08:00

1.9 KiB

A story consists of an optional message.txt, and a story.txt.

The text contained in message.txt is printed out before the story starts if the reader wants to read it.

story.txt format

The story.txt contains entries that are parsed by chooventerp, line by line. Each entry is considered a page, with 5 sections delimited by '|'. For example:

i|title|Text should go here./Second line ~/~/"What should we do?" says Turtle.|SUSPENSE! Do something, reader!|Foo the bar~foo;Bar the baz~Leap into page~2

'i' is considered the page name, 'title' is the title, the 3rd section is the main text, the 4th section is the suspense, and the 5th section lists the choices.

All sections can have newlines in them by using forward slashes. You'll have a bad time adding it in the page name though, since user input can't include newlines.

In the 3rd section, the "text" section, an image can be prompted for by using '~'. Chooventerp will look for a corresponding image in img/ using the page name with the suffix '.jpg' and display it if it exists. Subsequent images prompted will have the same page name, but will be differentiated with '(1)' for the 2nd image, '(2)' for the 3rd image, etc.

The 4th section is suspense text, for added effect.

The 5th section, the "choices" section, has a specific format. The choices are delimited by ';'. Each choice can be one of 2 forms:

Foo the bar~foo

This is printed by chooventerp as "Foo the bar: Go to Page foo" If the default of "Go to Page" isn't suitable for the situation the characters are in, the second form can be used.

Bar the baz~Leap into page~2

This is printed by chooventerp as "Bar the baz: Leap into page 2"

If the choices section is simply 'END', it's considered the same as 'Go backback;Start overrestart' by chooventerp.

Special pages

There are 3 pages that are considered special: 'i', 'back' and 'restart'. Page 'i' is considered the entry point for a story, 'back' and 'restart' are reserved by chooventerp.