Hey guys and/or girls,
sorry to bother you again
I’m trying to make a conversation puzzle that does stuff depending on what the player says to a character.
The hallway is a room. "hallway description."
A man named Nilson is here. Nilson is undescribed.
The description of Nilson is "[line break]You spot the half-empty bottle of Jim Bean tucked under his arm. He looks and smells like he hasn[apostrophe]t showered, shaved or changed his clothes in a while. Even in your line of work, you find it pretty hard not to sorry for the guy."
Nilson is carrying a bottle of Jim Bean.
Instead of taking the bottle of Jim Bean, say "[line break]Nilson turns away and sneers, 'This bottle is my only consolation and you try to take it away from me!? You[apostrophe]ve done enough to me already!'"
HallwayDoor is a closed door. HallwayDoor is west of the hallway and east of the entryway.
Before opening HallwayDoor:
If blockhallwayexit is in the void:
say "[line break][one of]As you try to exit the premises, you are accosted by former client--what's his name? That[apostrophe]s right, Nilson. He is sobbing hysterically and muttering incoherent words under his breath. Must be repining over the case you just cracked where you caught his wife with a younger man. You sigh, 'Not another one. Why do these lunatics pay me to confirm their suspicions, only to deny it once I reveal it to them? It seems it[apostrophe]s always these pathetic business-types too.' He points at you with his crooked finger, and finally articulates a 'Y-y-you!'[or]Better deal with this guy first. He seems to be blocking your exit.[stopping]" instead.
Instead of asking Nilson to try doing something:
repeat through Table of Nilson's Commentary:
if player's command includes topic entry:
say "[commentary entry][paragraph break]";
try result entry;
rule succeeds;
say "[line break][one of]Nilson sobs[or]'Oh Lorraine! Why?'[purely at random]".
Instead of speech when the noun is Nilson:
repeat through Table of Nilson's commentary:
if the topic understood includes topic entry:
say "[commentary entry][paragraph break]";
try result entry;
rule succeeds;
say "[line break][one of]Nilson sobs[or]'Oh Lorraine! Why?'[purely at random]".
Table of Nilson's Commentary
topic commentary result
"Lorraine" "Oh Lorraine, why did she leave me?" DealingWithNilson
"blah" "blah blah blah blah." screaming
"calm down" "you calm down!" screaming
"want" "what do you want?" screaming
"okay/ok" "you would say that wouldn[apostrophe]t you?" screaming
[yelling/screaming]
Understand "scream" as screaming.
Understand "yell" as screaming.
Screaming is an action applying to nothing.
Report screaming: say "You yell - '[bold type]Aarrggghhh!!![roman type]'[line break]".
Understand "DealWithNilson" as DealingWithNilson.
DealingWithNilson is an action applying to nothing;
Carry out DealingWithNilson:
remove blockhallwayexit from play.
The void is a room.
In the void is an object called blockhallwayexit.
I’m sure there are better ways to achieve this, but Blockhallwayexit is my convoluted n00bish way of trying to get it so you cannot leave until you say the right thing to Nilson. Bear with the crappy dialogue. It’s just filler right now. But I’m trying to get it to remove the blockhallwayexit object from play if the correct thing is said or mentioned. The try screaming works, but inform does not recognize DealingWithNilson. I tried using a phrase instead of an action, but no dice.
1.) My first question is, how can I make it so mentioning the right thing removes blockhallwayexit?
2.) second, I noticed that “includes” only works with like the first three words. Is there a way to detect if the player mentions the topic entry at all? It does not recognize, “You need to calm down,” but it does recognize “calm down.”
3.) I asked this earlier. Is there a way I can make it so that I don’t have to say “Nilson, blah blah blah” in order to respond to Nilson?
I really appreciate your help.