Thought Suggestions
Overview
The "Thought Suggestions" extension changes the behaviour of the THINK command so that it displays a list of suggested topics the player can THINK ABOUT (just as the TOPICS command displays a list of suggested conversational topics). The commands HYPER SUGGS and ENUM SUGGS will affect the list of suggested Thoughts in the same way as for conversational topics (respectively hyperlinking and numbering the suggestions).
To implement this extension you need to include it in your game, after the adv3Lite library files but before your other game files. You also need to create a number of Thought objects located in a ThoughtManager object as described in the documentation for Thoughts. Both thoughts.t and actor.t must be present among your library files (as they are by default). In addition you will need to define the name property on any Thought you wish to be suggested. This and the other modifications to the Thought class are explained in more detail below.
Enhancements to the Thought Class
This extensions adds the following properties to the Thought class which you can use to define how Thoughts are suggested:
- name: This is the name of the Thought you want to be displayed following the introductory 'You could think about '. It should match the vocab of the Topic or Thing this Thought matches (so that the player can use the name to THINK ABOUT this thought). Alternatively, you can just set the autoName property to true.
- autoName: If this is true then the extension will set the name of this Thought to the name of its associated Topic or Thing (unless you have already defined name to be something else).
- curiosityAroused: An expression (e.g., gRevealed('foo')) that should evaluate to true when we want this Thought to be suggested. Note that both curiosityAroused and curiositySatisfied need to be overridden by expressions or methods) in game code if something other then their default values (or true and nil respectively) are needed.
- curiositySatisfied: An expression (e.g., gRevealed('bar')) that should evaluate to true when we no lomger want this Thought to be suggested. This needs to be overriden by game code if desired; the extension makes no attempt to update curiositySatisifed to true when, say, a Thought topic has been suggested once or so many times, as each game will probably want to handle this in a different way.
- listOrder: The listOrder can be used to determine the order in which Thought suggestions are listed. Thoughts with a lower listOrder will be listed before Tboughts with a higher listOrder. By default we give all Thoughts a listOrder of 100.
Note that for a Thought to be suggested, its isActive property must also be true.
Thought Suggestions and Thinking Rules
A THINK command may also be set up to use rules to give varying responses. This raises the question of how such rules would interract with conversation suggestions provided by this extension.
By default, if the response to a THINK command is handled by a rule (in the RuleBook defined on Think's ruleBook property), thought suggestions will not be displayed on the same turn. If you want thought suggestions to be displayed regardless, you can override Think's suggestAlways property to true, which will result in any available thought suggestions being displayed after any output from your RuleBook.