lua.wetgenes.gamecake.fun.chatdown.text
Here is some example chatdown formatted text full of useful information, it it is intended to be a self documented example.
- This is a single line comment
-- This is the start of a multi-line comment
All lines are now comment lines until we see a line that begins with a
control character leading white space is ignored. If for some reason
you need to start a text line with a special character then it can be
escaped by preceding it with a #
What follows is a list of these characters and a brief description
about the parser state they switch to.
1. - (text to ignore)
A single line comment that does not change parser state and
only this line will be ignored so it can be inserted inside
other chunks without losing our place.
2. -- (text to ignore)
Begin a comment chunk, this line and all lines that follow this
line will be considered comments and ignored until we switch to
a new parser state.
3. #subject_name
Begin a new subject chunk, all future topic,goto or tag chunks will
belong to this subject.
The text that follows this until the next chunk is the long
description intended for when you examine the character.
Although it makes sense for a subject chunk to belong to one
character it could also a group conversation with tags being
set to change the current talker as the conversation flows.
subject names have simple cascading inheritance according to their
name with each level separated by a dot. A chunk named a.b.c
will inherit data from any chunks defined for a.b and a in that
order of priority.
4. >topic_name
Begin a topic chunk, all future goto or tag chunks will belong
to this topic, the lines that follow are how the character
responds when questioned about this topic followed by one or
more gotos as possible responses that will lead you onto
another topic.
Topics can be broken into parts, to create a pause, by using an
unnamed goto followed by an unnamed topic which will both
automatically be given the same generated name and hence linked
together.
5. <goto_topic_name
Begin a goto chunk, all future tag chunks will belong to this
goto, this is probably best thought of as a question that will
get a reply from the character. This is a choice made by the
player that causes a logical jump to another topic.
Essentially this means GOTO another topic and there can be
multiple GOTO options associated with each topic which the
reader is expected to choose between.
6. =set_tag_name to this value
If there is any text on the rest of this line then it will be
assigned to the tag without changing the current parse state so
it can be used in the middle of another chunk without losing
our place.
This single line tag assignment is usually all you need.
Alternatively, if there is no text on the rest of this first
line, only white space, then the parse state will change and
text on all following lines will be assigned to the named tag.
This assignment can happen at various places, for instance if
it is part of the subject then it will be the starting
value for a tag but if it is linked to a topic or goto then the
value will be a change as the conversation happens. In all
cases the tags are set in a single batch as the state changes
so the placement and order makes no difference.
Tags can be used inside text chunks or even GOTO labels by
tightly wrapping with {} eg {name} would be replaced with the
value of name. Tags from other subjects can be referenced by
prefixing the tag name with the subject name followed by a forward
slash like so {subject/tag}
The hierarchy of these chunks can be expressed by indentation as all
white space is ignored and combined into a single space. Each SUBJECT will
have multiple TOPICs associated with it and each TOPIC will have
multiple GOTOs as options to jump between TOPICs. TAGs can be
associated with any of these 3 levels and will be evaluated as the
conversation flows through these points.
So the chunk hierarchy expressed using indentation to denote children
of.
SUBJECT
TAG
GOTO
TAG
TOPIC
TAG
GOTO
TAG
The GOTO chunks in the root SUBJECT chunk are used as prototypes so if a
GOTO is used in multiple topics its text can be placed within a GOTO
inside the main SUBJECT chunk rather than repeated constantly. This will
then be inherited by a GOTO with no text. An alternative to this
shorthand is to assign an oft-used piece of text to a tag and reference
that in each topic instead.
SUBJECTs and TOPICs also have simple inheritance based on their names this
enables the building of a prototype which is later expanded. Each
inheritance level is separated by a dot so aa.bb.cc will inherit from
aa.bb and aa with the data in the longer names having precedence. This
inheritance is additive only so for instance a TAG can not be unset and
would have to be changed to another value by aa.bb.cc if it existed in
aa.bb or aa.
In practise this means
<br/>
<br/>