Giving instructions over a radio

I had an issue related to the problem I mentioned previously where the parser was requesting a disambiguation (Tom vs Tom’s body). When I applied the regular expression as a condition on putting Tom and objects in scope, it didn’t match after the disambiguation. So I relaxed the check temporarily.

I don’t have any persuasion rules yet. If there are no objects, I get the standard “Tom has better things to do.” However, if there are objects, I get “There is no reply.” Even if I write a persuasion rule that should capture the action, I get this response.

What happens if you just have

persuasion: rule succeeds

which allows all attempts at persuasion

These require Tom to be touchable as well as in scope, so will be blocked by the usual mechanisms with the rather more appropriate (in this context) ‘You can’t reach into whatever-is-Tom’s-location’

1 Like

Have you changed the reaching inside rules so that you can reach into Tom’s location?

EDIT: this is the (equally unhelpful) response you get from the parser instead of ‘You can’t reach…’ if you have allowed reaching inside Tom’s location and have asked Tom to interact with something that is not in scope for Tom

Thanks, Dr. Bates. Indeed, I have a reaching into rule. However, even though I have placed the objects in scope, they are not in Tom’s location. I have a before rule that moves Tom to that location.

I should note that if I ask Tom to do something with something in his location, I get the “he has better things to do” response.

Okay, maybe it’s better to show what I have. These are all the relevant rules. The actual character’s name is Tony Bleet, not Tom.

After deciding the scope of the player when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet:
	[if the player's command matches the regular expression "^\s*tony\,", case insensitively begin;]
	if the player's command matches the text "tony", case insensitively begin;
		place Tony Bleet in scope;
		if the noun is something and the noun is known and the noun is enclosed by PlazaRegion begin;
			place the noun in scope;
		end if;
		if the second noun is something and the second noun is known and the second noun is enclosed by PlazaRegion begin;
			place the noun in scope;
		end if;
	end if.

Rule for reaching inside Vendor Row Plaza when the player is carrying the short-wave radio and Defending Lab from Church is happening and the setting of the radio dial is 3 and the location of the player is not the location of Tony Bleet:
	[if the player's command matches the regular expression "^\s*tony\,", case insensitively:]
	if the player's command matches the text "tony", case insensitively:
		allow access.

Persuasion rule for asking Tony Bleet to try aiming the concave mirror at something: persuasion succeeds.

Before Tony Bleet aiming the concave mirror at something:
	now Tony Bleet is in Plaza By Lab.
	
Carry out Tony Bleet aiming the concave mirror at something (called s):
	now the decorative statuette is manually held.

I suppose the before rule makes no sense, since it is never invoked.

The reason for this unexpected response is that if you ask Tom to interact with something that is out of scope for him, the parser is unable to generate an action matching the command and so falls back on its default when it can’t recognise a sensible action in what Tom is being asked to do- generate an ‘Answering it that’ action with all the text after the comma as the topic.

So ‘Tom, value the bracelet’ becomes 'Answering Tom that “value the bracelet” ’

And, perhaps unexpectedly, the action definition of ‘answering it that’ in the Standard Rules is as follows:

Answering it that is an action applying to one thing and one topic.

i.e. whoever you’re answering to must be touchable (!)
Therefore the basic accessibility rules run, and as Tom is in a room different to the player, the action fails due to the ‘can’t reach inside rooms rule’ with the response ‘You can’t reach into the cellar’, as if you’re trying to reach into the cellar and grab him by the lapels in order to talk to him!

If we overcome this by adding a reaching inside rule to make the cellar accessible, 'Answering Tom that “value the bracelet” ’ clears the basic accessibility rules and reaches the Report stage:

Report an actor answering something that (this is the block answering rule):
	if the actor is the player:
		now the prior named object is nothing;
		say "[There] [are] no reply." (A);
	stop the action.

Hence the cryptic response ‘There is no reply’.

You can watch all this unfold if, before sending commands to Tom, you type ‘actions’ then ‘rules all’.

1 Like

If you’re asking Tony to interact with something it has to be in scope for Tony, not for the player.

So you want

After deciding the scope for Tony...

for those things that need to be in scope for Tony.

Obviously, in order to send commands to Tony you also need

After deciding the scope for the player...

to put Tony into scope for the player.

Thanks, Dr. Bates. You’ve given a good way to respond when the player issues a command with objects that are not relevant. I can write an “Instead of answering Tony Bleet that” rule.

Also, great tip about writing a rule for adding objects to Tony’s scope. I don’t think I would have got there on my own.

Unfortunately, I think I’m running up against my problem with the parser. After the ambiguation is answered, “noun” and “second noun” are not defined. Maybe they are now stored in a different place? At any rate, I should probably solve the issue with the parser before proceeding.

Do you think writing a “Does the player mean” rule is the right approach, or even possible?

How are you incorporating Tom’s body?

With

 A body is a kind of thing. Every person incorporates a body.

I’m not getting a request for disambiguation when I send a command to Tom- unless I give the body a name that includes ‘Tom’

If you use a ‘Before…’ rule, which will run before accessibility rules, you can dispense with your reaching inside rule…

I think these are all the relevant rules.

Spirit-possession relates one citizen to one body. The verb to be spirit-owner of means the spirit-possession relation.
The spirit-world is a privately-named closed unopenable container. It is part of the ether.
Definition: a citizen is dead if he is in the spirit-world. 
Understand "corpse" as a body when the item described is not part of a citizen.

After printing the name of a body:
	omit contents in listing.

Setting action variables when the noun is a body which is part of a citizen (called owner):
	now the noun is the owner. 

Setting action variables when the second noun is a body which is part of a citizen (called owner):
	now the second noun is the owner.	
	
Setting action variables when the noun is dead and the noun is spirit-owner of a visible body (called the mortal remains):
    	now the noun is the mortal remains.

Does the player mean doing something with a body: it is unlikely.
Does the player mean doing something to a body: it is unlikely.
Does the player mean throwing something at a body: it is unlikely.

Departing this world is an action applying to one thing.
Carry out departing this world:
	let the corpse be a random body which is part of the noun;
	move the corpse to the location of the noun;
	move the noun to the spirit-world;
	let L be the list of things worn by the noun;
	repeat with item running through L:
		now the corpse is wearing item;
	let L be the list of things carried by the noun;
	repeat with item running through L:
		now the corpse has item.

When play begins:
	repeat with victim running through citizens:
		let the corpse be a random body which is part of the victim;
		now the victim is spirit-owner of the corpse.

Forgot this:

A body is a kind of container. A body is a part of every person. A body is usually open and opaque. A body is not portable. The size of a body is large.

What is interesting to me is the ambiguity does not happen if the interlocutor is present, only when I have to place him/her in scope because conversation is happening over the radio.

Now that I am looking at the rules, perhaps it’s unnecessary to have the body be a part of the person. It does allow the player to refer to a person’s body while they are alive, but is it really necessary?

Well, I’ve included all those rules and I’m still not being asked for disambiguation!

Interesting! This is great, because it means something else is up and I won’t waste more time on a dead end. I will investigate further.

I wonder if the question is about who/what to place in scope?

Okay, I can answer my own question when using “rules all” and I see that the scope rule is invoked and then the engine moves on to other rules.

A request for disambiguation is generated by the parser, when it is able to match more than one object to a single grammar token and is unable itself to decide between the possibilities. It therefore only ever arises when considering something the player has typed, not something in the source code.

What happens when you type ‘scope’, both when Tony is present and when he’s absent but on the radio?

When present, both Tony and his body are in scope. When not present, they are not. They are also not present when the parser asks for disambiguation.

Tom, take the ingot worked though. Taking the bracelet and necklace fail for accessibility reasons not having to do with scope or visibility: if you make the demi-john and strongbox open, those work too.

Tom, take the ingot worked though → well, that’s because the ingot is both in scope and touchable (for Tom)

Taking the bracelet and necklace fail for accessibility reasons not having to do with scope or visibility: → taking the bracelet would fail for accessibility reasons, but it doesn’t get as far as building an action and running basic accessibility because it’s out of scope- hence the ‘You can’t reach…’ response triggered by the fallback action 'Answer Tom that “take the bracelet” ’ (see reply above), The necklace however, which is in scope (despite the darkness), gets an action built but then fails the basic accessibility rules- hence the ‘Tom is unable to do that’ response. Opening the containers makes both bracelet and necklace both in scope and accessible, of course, and the intended action now succeeds.

1 Like

My point was that out-of-scopeness for the player – the thing I was mistakenly thinking would be relevant through several posts here yesterday – isn’t relevant. The player can refer to things in commands that are out of scope for the player without a problem.