![]() |
GlassAn interactive fiction by Emily Short (2006) - the Inform 7 source text |
| Home page Contents Previous Next Complete text | Section 3 - Non-player Goal-seeking
[And here we provide the non-player characters with the instructions for how to make conversational "moves".] [At different scenes of the game, we will be using different conversation sets, so we need to account for this as well:] Conversation set is a table-name that varies. The conversation set is Table of Prologue Remarks. Definition: a subject is fruitful if it produces conversation. [This rather bare-looking routine runs through the current conversation table and checks to see whether a given subject would be interested if someone selected it.] To decide whether (next subject - a subject) produces conversation: repeat through conversation set begin; if the starting entry is current subject or starting entry is blank begin; if the final entry is next subject or final entry is blank, yes; end if; end repeat; no. [And here we look through the conversation set to see if we can find some appropriate conversation for the change of subject that just occurred, and (if so) print the dialogue.] To relate (initial subject - a subject) with (next subject - a subject), directly or pausing first: repeat through conversation set begin; if the starting entry is initial subject or starting entry is blank begin; if the final entry is next subject or final entry is blank begin; if pausing first, say "There is a long thoughtful silence. "; say "[comment entry][paragraph break]"; blank out the whole row; rule succeeds; end if; end if; end repeat. A person can be active or passive. [1] Every turn when the old lady is active: if Theodora Endgame is happening, rule succeeds; if Lucinda Endgame is happening, rule succeeds; let pause be "blank"; let segue be the next step via the suggestion relation from the current subject to the target subject; if segue is a subject begin; while segue is not the target subject and segue is not fruitful begin; let segue be the next step via the suggestion relation from the segue to the target subject; let pause be "There's a long, thoughtful sort of pause. "; end while; if pause is not "blank", relate the current subject with the segue, pausing first; otherwise relate the current subject with the segue, directly; change last subject to current subject; change current subject to segue; otherwise; change the current subject to last subject; if Fitting has happened begin; make no decision; end if; say "There's an uncomfortable silence as everyone tries to think of a sensible direction for the conversation to take from here. 'Mm, we were speaking of [current subject],' says [a random visible person who is not the player]."; end if. Every turn: now the old lady is active. [2] |