version 4 by Mark Tilford
- Example: * Simplest Chat - Have a simple conversation with Larry. Shows how to use the basic functionality of Simple Chat.
- Example: ** Less Simple Chat - Shows off a few of the more advanced features of Simple Chat: nodes that get activated during play; nodes that can be chosen only once, or appear in the menu only once; mixing other actions with simple chat conversations.
Section: Using Simple Chat
This is an extension to handle simple menu-based conversations, or anything else for which you want to use an in-text menu. Simple Chat differs from Emily Short's Menus in that the latter replaces the normal game window by a menu navigated with the arrow keys, whereas Simple Chat prints a list of numbered options in the game text itself. In addition, Simple Chat makes it easy to set up the kind of connections that one needs for a menu-based conversation.
The basic kind of value introduced by the extension is the chat node. For each thing the player can say, the author defines a chat node value: "Harry-on-aliens is a chat node". To keep things organized, consider starting the name of each node with the name of the character the player is talking with, or something else related to the overall conversation.
For all chat nodes, you must put in an "Instead of giving text for ___: ..." override. This function is to display the text for when the player is at that chat node.
For all chat nodes which are linked from some other chat node (which will generally be all those which are not ones which start conversations), you must put in an "Report giving link to ___: ... instead" override. This function is to display the text which will be listed in the menu. If you want the text to vary depending on the previous chat node, you may instead use "Report giving link to ___ when second chat node is ___:".
For all chat nodes which are to display a menu, you must put in a "Carry out finding responses to ___:" override. For each chat node the player can go to from here, put in "link to ___". If no chat nodes are linked to, then the conversation will stop. You can use conditionals in these phrases to change the contents of the menu based on the state of the game, e.g., "if player wears the weird hat, link to ___".
The "link to ___" phrase has no effect if the chat node is not active. Every chat node has an activatedness: either sc-active, sc-inactive, sc-once or sc-shown-once. These can be set at the beginning of the game with declarations like "____ is sc-once". If no declaration is made, a chat node starts as sc-active.
An sc-active chat node is shown when it is linked to, while an sc-inactive chat node is not shown. Chat nodes that are sc-once are shown normally, but will be set to sc-inactive once they are chosen, thus disappearing from the menu. Chat nodes that are sc-shown-once are also shown normally, but will be set to sc-inactive after being displayed in a menu, whether they are chosen or not: in effect, the player has only one chance to choose them.
During play, chat nodes can be actived or deactived by "activate ___" and "deactivate ___". (These are easier-to-read equivalents of "now ___ is sc-active" and "now ___ is sc-inactive".)
Finally, to show the menu starting from a certain chat node, put in "run a conversation from ___". Simple Chat does not define a "talking to" action -- this is left to the author of the game.
There can be at most twenty links printed from any chat node. Any more will be silently dropped. This number can be increased by adding rows to the Table Of Current Choices.
By default, the player can get out of any menu by choosing 0. To change this for all menus, put "When play begins: allow exiting on zero." at the beginning of the file. To change this for some menus, put "allow exiting on zero;" or "forbid exiting on zero;" in the appropriate "give text for ..." or "find responses to ..." block.
The only text a user should ever see which is printed by Simple Chat is "or 0 to say nothing". In games using the German or French translation extension, this is replaced by "oder 0 um nichts zu sagen" and "ou 0 pour ne rien dire" respectively. Other non-English games should add a translation by adding something like the following line:
To say simple chat zero option:
say "or 0 to say nothing[run paragraph on]".