"Chat By Topic" by Leandro Ribeiro Release along with source text. Volume - Chat By Topic Book - Includes Include Epistemology by Eric Eve. Include Complex Listing by Emily Short. Book - Engine Chapter - Creating a Chat-Pall The chat-pall is an object that varies. A person can be chattable or mute. A person is usually chattable. A person can be talking or silent. A person is usually silent. A person can be greeted. A person is usually not greeted. Chapter - Changing Ask/Tell and NOUN, hello Before telling someone about something: say talk-to instead. Before asking someone about something: say talk-to instead. before asking someone for something: say talk-to instead. Instead of answering someone that something: if the player's command includes "hello/hi": try greeting the noun; otherwise: say talk-to instead. Chapter - Creating the Chat Action Chatting it about is an action applying to two visible things. after chatting someone about something: say "[default-chat-line]"; remove the second noun from discussed-things of the chat-pall; now last-discussion of the chat-pall is temp-discussion. Chapter - Memory A person has a list of objects called discussed-things. A person has an object called last-discussion. last-discussion is usually nothing. Temp-discussion is an object that varies. Carry out chatting it about: now temp-discussion is the last-discussion of the chat-pall; now last-discussion of the chat-pall is the second noun; remove nothing from discussed-things of the chat-pall, if present; say remove the second noun topic-suggestion; say run paragraph on. Definition: a thing is discussed if it is listed in discussed-things of the chat-pall. To decide whether (T - a thing) is discussed with (P - a person): if T is listed in discussed-things of P, decide yes; decide no. To decide whether (T - a thing) is not discussed with (P - a person): if T is discussed with P, decide no; decide yes. Chapter - Chatting by Topic s-chatting is an action applying to one visible thing. Understand "[any known thing]" as s-chatting while dialog is happening. Check s-chatting: if the noun is unknown: say "[ignoring-text]" instead. Carry out s-chatting: try chatting the chat-pall about the noun. Chapter - Misc Text Mumbling is an action applying to one topic. Understand "[text]" as mumbling while dialog is happening. Report mumbling: say "[ignoring-text]" Chapter - Start Dialog Greeting is an action applying to one visible thing. Understand "greet [something]" and "talk to [something]" and "talk [something]" as greeting. Check greeting: if the noun is not a person, say not-person instead; if the noun is the player, say internal-monologue instead; if the noun is mute, say not-interested instead; if the noun is the chat-pall, say already-talking instead. Carry out greeting: if the chat-pall is not nothing, say "[change-chat-pall]"; now all visible people are silent; now the chat-pall is the noun; now the noun is talking; say "[greeting-line of the noun]"; say line break; now the noun is greeted. Rule for supplying a missing noun while greeting: now the noun is a random visible chattable person. Chapter - End Dialog Dumping is an action applying to one visible thing. Carry out dumping: now the noun is silent; say "[dumping-line of the noun]"; say line break; now the chat-pall is nothing. Rule for supplying a missing noun when dumping: now the noun is the chat-pall. Understand "goodbye" and "good bye" and "bye" as dumping while dialog is happening. Instead of answering someone that "bye/goodbye", try dumping the noun. Chapter - To Be Silent answering with silence is an action applying to one visible thing. Understand "silence" and "silent" and "remain silent" as answering with silence while dialog is happening. Carry out answering with silence: say "[silent-line of the chat-pall]"; say line break. Rule for supplying a missing noun when answering with silence: now the noun is the chat-pall. Book - Suggestions Chapter - Suggestion Lists A person has a list of objects called topic-suggestions. Chapter - The Misc-suggestion A misc-suggestion is a kind of thing. A misc-suggestion is usually proper-named. A misc-suggestion is usually familiar. A misc-suggestion has a number called seqno. The seqno of a misc-suggestion is usually 100. yes-suggestion is a misc-suggestion. The printed name is "yes". The seqno is 10. no-suggestion is a misc-suggestion. The printed name is "no". The seqno is 12. yes-no-suggestion is a misc-suggestion. The printed name is "say yes or no". The seqno is 10. Instead of saying yes when dialog is happening: try answering with silence. Instead of saying no when dialog is happening: try answering with silence. Chapter - Listing Suggested Topics Listing suggested topics is an action applying to nothing. Carry out listing suggested topics: let n-t-suggs be the number of entries in the topic-suggestions of the chat-pall; if n-t-suggs is 0: say "[nothing-specific]"; rule succeeds; say "[pre-topics]"; say "[topic-suggestions of the chat-pall in topic format]. [silent-goodbye]"; say run paragraph on. To say (L - a list of objects) in topic format: set up l for topic printing; say "[the prepared list delimited in personal style]" To set up (l - a list of objects) for topic printing: repeat with item running through l: now the item is marked for special listing; register things marked for listing. Table of List Style Assignments (Continued) list style first delimiter second delimiter alternate second delimiter indefinite name phrase definite name phrase personal ", " "[if the serial comma option is active],[end if] or " " or " "[current listed object]" "[current listed object]" Chapter - Some Useful Phrases To say remove (obj - a thing) topic-suggestion: remove obj from the topic-suggestions of the chat-pall, if present. To say add (obj - a thing) topic-suggestion: now obj is familiar; add obj to the topic-suggestions of the chat-pall, if absent. To say clear topics: truncate topic-suggestions of the chat-pall to 0 entries. Chapter - Cosmetics in topic-suggestion Before listing suggested topics: say italic type; say run paragraph on. After listing suggested topics: say run paragraph on; say roman type. Before printing the name of a familiar thing when listing suggested topics: say roman type; say bold type. After printing the name of a familiar thing when listing suggested topics: say roman type; say italic type. Book - Dialog Scene Chapter - Creating The Scene Dialog is a recurring scene. Dialog begins when at least one talking person is visible. Dialog ends when all visible people are silent. Chapter - While Scene is Happening When dialog begins: now the command prompt is "[dialog-prompt]". When dialog ends: now the command prompt is ">". Before going somewhere when dialog is happening: try dumping the chat-pall. Every turn while dialog is happening (this is the list topics rule): add last-discussion of the chat-pall to discussed-things of the chat-pall, if absent; topics are listed in 0 turns from now. At the time when topics are listed: try listing suggested topics; [after this line debugging takes place] if chat-dbg is true: say "Current chat-pall: [chat-pall]."; say "Last discussed topic: [last-discussion of the chat-pall]."; say "Discussed topics: [discussed-things of the chat-pall]." chat-dbg is a truth state that varies. chat-dbg is false. The list topics rule is listed last in the every turn rulebook. Chapter - Debugging Chat (not for release) chat-dbg-switching is an action applying to nothing. Understand "chat-dbg" as chat-dbg-switching. carry out chat-dbg-switching: say "[bracket]Chat-debug is now [bold type][run paragraph on]"; if chat-dbg is false: now chat-dbg is true; say "on"; otherwise: now chat-dbg is false; say "off"; say "[roman type][close bracket][paragraph break]" Book - Default Text Chapter - Default Answers by NPCs People have some text called greeting-line. The greeting-line of a person is usually "'Hello [if the chat-pall is greeted]again[otherwise]there[end if]!', says [the chat-pall]." People have some text called dumping-line. The dumping-line of a person is usually "'Farewell, then.' says [the chat-pall]" People have some text called silent-line. The silent-line of a person is usually "[The chat-pall] smears." To say default-chat-line: say "[The chat-pall] turns at you as you mention [the second noun]."; say line break; say "Not knowing what to say, he just nods." To say ignoring-text: say "Not knowing what to say, [the chat-pall] just nods." To say change-chat-pall: say "You turn away from [the chat-pall], so that you can address [the noun]." Chapter - Default Parser To say talk-to: say "[italic type]Try TALK TO [noun][roman type]." To say dialog-prompt: say "[italic type]Talking with [the chat-pall] >[roman type]" To say goodbye-suggestion: say "[italic type]To leave the conversation, you should type [roman type][bold type]goodbye[roman type]." To say not-person: say "It would be like mumbling alone." To say internal-monologue: say "Internal monologues are fascinating." To say not-interested: say "[The noun] doesn't seem interested in chatting with you." To say already-talking: say "You're talking to [the noun] already." To say nothing-specific: say "No obvious topic comes to mind, but you can still try something, remain [roman type][bold type]silent[roman type][italic type] or say [roman type][bold type]goodbye.[roman type][italic type]" To say pre-topics: say "Possible topics: " To say silent-goodbye: say "[italic type]You can also try something else, remain [roman type][bold type]silent[roman type][italic type] or say [roman type][bold type]goodbye[roman type][italic type]." Volume - The Test Game Chapter - Misc Stuff A subject is usually unfamiliar. Instead of taking inventory: let X be the number of things carried by the player; let Y be the number of subjects carried by the player; if Y is X: say "You carry nothing at the moment."; otherwise: now all things carried by the player are marked for listing; now all subjects carried by the player are unmarked for listing; say "You carry:[line break]"; list the contents of the player, listing marked items only, with newlines. [I wrote this piece of code so that I can make the player carry some subjects with him. This would allow for interesting things, like remembering choices the player has made in a dialog. I ended up doing everything with "last-discussion" and "X discussed with Y", but I left it here... just in case.] Chapter - Rooms Street Cafe is a room. "Dark and gloomy. All the tables are empty and the chairs are turned upside down. This place will be closing any time soon." Tables is in Cafe. It is scenery. The description is "They're empty." Understand "table" as tables. Counter is in Cafe. It is scenery. The description is "Green and glossy. It seams clean." a glass is in cafe. The description is "A container of anti-depressives." stout beer is in the glass. The description is "Stout, a match between sweet and sour that can only have been made in heaven." The printed name is "some stout" Rule for writing a paragraph about the glass: say "[one of]The counter as a vacant space, between a lovely poet and a teacher. You take your sit and order a stout beer. Outside the world pours depression on everyone. Inside the bartender pours beer in a clean glass. You end up thinking you choose your pourings well.[or]You're at the counter. A lovely poet and a teacher sit at each side. The bartender doesn't mind you at all. And then there's that nice glass in the counter[if the beer is in the glass], and that miracoulous stout sending thoughts of joy[otherwise], already empty[end if].[stopping]"; now the beer is mentioned; now all visible people are mentioned. Instead of drinking the beer for the first time: say "You take a zip. The world can wait." Instead of drinking the beer for the second time, say "Bitter sweet symphony." Instead of drinking the beer: say "All over. You can feel the world starting to crumble."; now the beer is off-stage. Instead of drinking the glass, try drinking the beer. Chapter - Chat Partners Section - Bartender The bartender is a mute person in cafe. The description is "He looks busy." When play begins: now the time of day is 1:55 AM. At 2:00 AM: now the chat-pall is nothing; now the bartender is chattable; now the printed name of the lovely poet is "help with poet"; now the printed name of the stout beer is "another beer"; try greeting the bartender; if dialog is not happening, try listing suggested topics. The greeting-line of the bartender is "Tired, yet firm, the bartender looks at his three guests and says 'Ok, it is time to go!' Then, pointing at the [if the last-discussion of the poet is love and the poet is mute]crying [otherwise if the last-discussion of the poet is might and the poet is mute]drunk [end if]poet 'And I'll need help putting this one out the door. Darn existentialists[add beer topic-suggestion][add poet topic-suggestion].'" After chatting the bartender about beer: say "'Not a fat chance, mate! I have kids. You're getting out.' He proceeds in putting you out the door with a broom."; end the story saying "You end the night on the streets." Understand "another" and "another beer" as beer when dialog is happening. After chatting the bartender about poet: say "'Well, but I won't charge any less for your beer.' You pick the poet up and exit with him over your shoulder."; end the story saying "You end the night on the streets." Understand "help" and "help with" and "help with poet" as the lovely poet when the chat-pall is the bartender. Instead of answering with silence when the chat-pall is the bartender: say "'What are you staring at me about? Get out.'"; end the story saying "You end the night on the streets." After doing something when dialog is happening and the chat-pall is the bartender: say "'Well, I ear no sounds of protest. Off you go.'"; end the story saying "You end the night on the streets." The dumping-line of the bartender is "'Well, aren't you the easy kind.'" After dumping the bartender: say "Slowly, you show yourself out, the world pouring depression on everyone."; end the story saying "You end the night on the streets." Section - Poet A lovely poet is a male person in cafe. The description is "White skin, shaved, thin, he is looking at his glass of vermouth and, you could swear, he is talking to his glass of vermouth." The greeting-line of the poet is "[one of]'I was expecting you. Are you a man of love or a man of might?[add love topic-suggestion][add might topic-suggestion]'[or]'The poet smiles. 'You again, I see. Well, not you, but the words of you.'[stopping]" The dumping-line of the poet is "'If you must. I'll write about you.'" might is a subject. after chatting the poet about might: say "[one of]'Relentless, talks to the fist.'[clear topics][add yes-suggestion topic-suggestion][add no-suggestion topic-suggestion][or]'Yes, might, relentless might.'[stopping]" instead of chatting the poet about love when might is discussed with the poet: say "[cant-take-all]" Understand "man of might" and "a man of might" and "of might" as might. Instead of saying yes when the chat-pall is the poet and might is discussed with poet: say "'I knew you would! You understand the clouds, you pity the sky, like me.'"; now the dumping-line of the poet is "He then rises a glass of vermouth and drinks it, falling flat face on the counter the next second."; try dumping the poet; now the poet is mute. Understand "man of love" and "a man of love" and "of love" as love. love is a subject. after chatting the poet about love: say "[one of]'Yes, I too love, I too suffer.'[clear topics][add yes-suggestion topic-suggestion][add no-suggestion topic-suggestion][or]'It begs for suffering.'[stopping]" Instead of chatting the poet about might when love is discussed with the poet: say "[cant-take-all]" Instead of saying yes when the chat-pall is the poet and the love is discussed with poet: say "'Of course, otherwise nothing but hate will await. Hate is stronger than heart. Heart?'"; now the dumping-line of the poet is "He then laughs as he looks at a glass of vermouth. He tilts the glass and the liquid falls on the counter. He starts to cry and pays no more attention to you."; try dumping the poet; now the poet is mute. Every turn when dialog is happening and the chat-pall is the poet and last-discussion of the poet is love or dialog is happening and the chat-pall is the poet and last-discussion of the poet is might (this is the Force To Decide rule): say decide. To say decide: say "[line break]The poet looks down and then he faces you again."; say line break; if last-discussion of the poet is might, say "'So, will you[one of] [or]or will you not [stopping]join me in might?'"; if last-discussion of the poet is love, say "'[one of]Tell me, would you suffer with me?'[or]So will you suffer with me or not?'[stopping]" To say cant-take-all: say "'No, no, no. You made your choice.'" Instead of saying no when the chat-pall is the poet and dialog is happening: now the dumping-line of the poet is "'Then we have nothing to discuss. Leave me alone.' says the poet."; try dumping the poet; now the poet is mute. Instead of greeting the poet when the poet is mute: if love is discussed with the poet, say "He's crying. He won't talk to you again." instead; if might is discussed with the poet, say "He's dead drunk. You won't be able to talk to him any time soon." instead; say "You've upset him. He won't talk to you again." after chatting the poet about the poet: say "'A pinch in the skew, I am.'" after chatting the poet about the cafe: say "'You've noticed it. Good for you.' he says. 'Well, I'm afraid of it, but surely I'm not alone.'" Instead of chatting the poet about something when last-discussion of the poet is might or last-discussion of the poet is love: say "'Don't mumble about, boy!' the poet exclaims.". Section - Teacher A teacher is a female person in cafe. The description is "Long, red hair. She looks nervous." The greeting-line of the teacher is "'[one of]Hello there!' she says. 'I can tell you marvelous marvelous marvelous things about Chemistry, Literature, and Geometry.' She giggles. [add chemistry topic-suggestion][add literature topic-suggestion][add geometry topic-suggestion][or]Oh, I do like you. You are a marvelous person, marvelous.'[stopping]" chemistry is a thing. It is a subject. after chatting the teacher about chemistry, say "'[if chemistry is discussed]As I told you, i[otherwise]I[end if]t's all about oxygen and the periodic table.' Then a high pitch giggle. 'All lovely things.'" literature is a thing. It is a subject. after chatting the teacher about literature, say "'[if literature is discussed]We've covered this before. [end if]Literature is dancing as the universe expands. She pauses for a moment. A short smile. 'Oh, sweet, sweet expansion.'" geometry is a thing. It is a subject. after chatting the teacher about geometry, say "'[if geometry is discussed]Geometry never bores me. [end if]I never grow tired of the lines that conceal my soul.' Such a high pitched voice, she has. She is breathing heavily. 'My soul, a geometrical space, a triangle.' she cries." Chapter - Instructions When play begins: say "Three NPCs are present, each representing a different kind of interaction. The [bartender] is a mute person. He won't talk to you if you try at the beginning, but he will start a conversation to close the bar. The [lovely poet] will have a guided conversation, and he will not allow you to talk about everything, so choice matters. On the contrary, the [teacher] will talk to you about all the available topics, with minor changes when a topic has been discussed already. It is a more traditional NPC. To start a conversation, try [bold type]talk to (the desired character)[roman type]. To turn DEBUG mode on and off, try [bold type]chat-dbg[roman type]."