How to disable the "talking to..." rule in a room

How can I disable the “Talking to…” rule in a specific room for a specific NPC?

So, in other words the player must not be allowed to speak to certain NPC’s when they can be seen in a specific room.

I have something like this (obviously not working):

	
The talking requirements rule does nothing when talking to the liaison Officer in the Operational-Area.
The can't talk what you haven't said rule does nothing when talking to the Liaison Officer ins the Operational-Area.
The block talking rule does nothing.

How can I achieve this?

What you want to do is to selectively block actions. Actions are a very different beast from rules, though many rules will be followed as the game follows a given action (and some rules may call for an action to be taken).

My Speechless extension provides an example of blocking talking (as well as references to the player character even being able to speak).

I think this is all you need, assuming Char is a person and Speechless is a room:

Asking char about something is talking.
Telling char about something is talking.
Asking char for something is talking.
Answering char that something is talking.

instead of talking when the location is speechless, say "no talk."

Persuasion for asking char to try doing anything when location is speechless: instead say "No talk."

This example shows them in use; the test me command will try each variant.

Lab is a room.
alice is a person in lab.
alice carries a wrench.
Speechless is north of lab.
bob is a person in speechless.
bob carries a bag.
char is a person in speechless.
char carries a string.

Asking char about something is talking.
Telling char about something is talking.
Asking char for something is talking.
Answering char that something is talking.

instead of talking when the location is speechless, say "no talk."

Persuasion for asking char to try doing anything when location is speechless: instead say "No talk."

test me with "alice, go north / ask alice about bob / tell alice about bob / ask alice for wrench  / say boo to alice / n / bob, go south / ask bob about alice / tell bob about alice / ask bob for bag / say boo to bob / char, go south / ask char about alice / tell char about alice / ask char for string / say boo to char".
1 Like

Thank, I will have a look and see how I can use it in my code.

I have checked your code and it could work but there is one problem with my code towards your recommendation.

What will happen if the person called “char”, in your example, is in the room but when the player enters the room for the first time he wants to talk to “char”, then the player leave the room and come back later and then (second time in room with “char”) he do not want to talk to “char”.

How can I change your code to achieve that?

I don’t follow what you intend the behavior to be. Should talking to Char not be blocked subsequent to the first visit to the room?

I want to be able to decide when and where the player can talk to or not talk to an NPC.

If I understand your code correctly talk to an NPC will be blocked indefinitely from the first entry to Room1.

I want to be able to control that.

I hope this explain my intend in a better way.

well, there are a zillion ways one might do that, and some of them might be better than others depending on the details of how you’ll be using it, but a global truth state variable could work.

shushed is initially true.

instead of talking when the location is speechless and shushed is true, say "no talk."

Persuasion for asking char to try doing anything when location is speechless and shushed is true: instead say "No talk."

[then, within some rule or phrase somewhere when you want to allow talking]:
  now shushed is false;

Thanks, my friend.

This looks as if it can work in my code.

I will try it out and let you know if it works or not.