Gen Helper Syntax

  • ;

denotes a comment, it will ignore the rest of the line after the ';'

  • [text]

is a token definition, the following lines after it define its possible phrases. Every time the definition is polled, it will return a different random result. The definitions library needs to have a [start] token definition to kick things off.

  • ![text]

is a static token definition. Every occurrence of this token will contain the same phrase and the same expansion of that phrase, as opposed to a random one each time. Keep in mind that due to the nature of static definitions, if a static token self-references in any of its phrase expansions anywhere, it will result in an infinite loop. The generator will try to detect static token loops beforehand and error out if it finds one.

  • <text>

is a token, it will be replaced by a random phrase pulled from its definition.

  • ~text

is a label, applied to the phrase that follows. This can be used tag and organize phrases and, most importantly, direct the path of story generation when coupled with label constraint lists.

  • %value

is a phrase chance tag. It sets a phrase's chance of being chosen to the given value (which can be a decimal). Any phrases not given a chance tag will automatically be given equal chance with whatever percent chance is left over. In other words, if there are 3 phrases and phrase 1 is given a 20% chance, phrase 2 and phrase 3 split the 80% that is left over, resulting in each having a 40% chance. If phrases given chance tags add up to more than 100% or if all phrases are given chance tags and the chances don't add up to exactly 100%, story generation will given an error.

  • {text1 text2 text3}

is a label constraint list. This list should be placed after a token definition declaration and is added to that token definition (it can be placed on the same line as the definition after the closing ']' or on subsequent lines). Multiple constraint lists can be added to the same token. During normal generation, one label will be randomly 'chosen' from each constraint list and the labels in that list will be added to a label blacklist. None of the phrases chosen by the token definition can contain any blacklisted labels, i.e., they are excluded. Furthermore, tokens words contained in the chosen phrase expansion will inherit the blacklist, proliferating this effect to all children of this token.

  • <test : label1 label2>

is a token with pre-defined constraint list selections. If any of the labels presented after the ':' are in any constraint lists associated with the token definition, those labels will be chosen 100% of the time instead of a label out of the constraint list being chosen randomly. This can help if you want a <character> token to be randomly male or female most of the time, but in a specific instance you can force it to be male with <character : male> (assuming you've labeled your phrases and built a constraint list accordingly).

  • *text or *<text>

will create a linked word or token, resulting in a hyperlink to a new page. These work a bit strangely; if a word in a phrase is found to be a link, that word will be the only word that replaces the token definition (as opposed to the whole phrase), and it will become a hyperlink that links to a page that holds the rest of the expansion for that key. Similarly, if a token is a link, that token's full expansion will become the hyperlink, and the full phrase's expansion will be on the linked page.

  • **text or **<text>

will create a 'hidden link' which functions the same as a link except that the word or token expansion only shows up in the hyperlink and not in the linked page's story. For example, if you want a character's name to be a hyperlink to a page with his description but his description doesn't contain his name anywhere, you can make his name a hidden link.

  • ^text or ^<word>

will omit the space between this word and the word before it

  • \n

will cause a line break in the text when it is displayed.

  • /

will continue the current line on the next line, in case your phrase is huge. It cannot break label prompt lists in the middle or other bracketed syntaxes

mind/envirogen/research-notes/gem-syntax.txt · Last modified: 2017/04/20 00:27 by wannaben
Back to top
CC Attribution-Share Alike 4.0 International = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0