[I7] Question on Report Rule Not Firing After Implicit Take

Hey all. My class is working on an example where I think I’m missing something obvious, but I’m not sure what.

First the context: the class is creating an example whereby objects can be scanned. If the scanner is not carried, the scanner will be implicitly taken. But only if the scanner is familiar.

Consider this source:

"Learning" by Jeff Nyman

Include Epistemology by Eric Eve.

The Learning Lab is a room.

A scanner is in the Learning Lab.
A vibranium robot is in the Learning Lab.

Scanning is an action applying to one thing.

Understand "scan [something]" as scanning.

Report scanning: say "Scanned."

A thing can be scanned or unscanned.
Carry out scanning: now the noun is scanned.

Check scanning (this is the scanner must be carried rule):
	if the scanner is familiar:
		if the scanner is not carried:
			say "It would help if you had the scanner.";
			silently try taking the scanner;
			if the noun is not carried, stop the action;
	otherwise:
		say "You would need to scan with something." instead.

After examining something: now the noun is familiar.

Test me with "actions / scan robot / examine scanner / scan robot".

The key issue we’re finding is with the Check scanning (this is the scanner must be carried rule).

Consider this output:

>test me
(Testing.)

>[1] actions
Actions listing on.

>[2] scan robot
[scanning the vibranium robot]
You would need to scan with something.
[scanning the vibranium robot - failed the scanner must be carried rule]

>[3] examine scanner
[examining the scanner]
You see nothing special about the scanner.

[examining the scanner - succeeded]

>[4] scan robot
[scanning the vibranium robot]
It would help if you had the scanner.
[(1) taking the scanner - silently]
[(1) taking the scanner - silently - succeeded]

[scanning the vibranium robot - succeeded]

>

The question is: Why didn’t the Report rule fire?

It seems to be due to the implicit take. Compare that output with this, where the scanner is taken explicitly:

>actions
Actions listing on.

>scan the robot
[scanning the vibranium robot]
You would need to scan with something.
[scanning the vibranium robot - failed the scanner must be carried rule]

>examine the scanner
[examining the scanner]
You see nothing special about the scanner.

[examining the scanner - succeeded]

>take the scanner
[taking the scanner]
Taken.
[taking the scanner - succeeded]

>scan the robot
[scanning the vibranium robot]
Scanned.
[scanning the vibranium robot - succeeded]

Here we see the “Scanned” report rule fire.

What’s the painfully obvious thing I’m missing?

“The noun” refers to the robot, so “if the noun is not carried, stop the action” triggers. It should be “if the scanner is not carried”.

(You might also want to add a check that confirms the scanner is in scope before trying to take it implicitly, unless it’s certain that it’s always around once it’s familiar.)

Ah! Of course!

This is a great addition to the lesson, actually. Thanks for the quick response.

Good advice on the scope. In this current case, the scanner will always be around. But I’m gradually working out examples of more complexity so I can see evolving the lesson to where we move the scanner out of scope and then put in a scope rule.

Thanks again.