Peculiar behaviour of "telephone" example code

Have been trying to use the telephone code, which is demonstrated in the Four Cheeses example, in a project of my own.
I have the telephone code working perfectly in a program that contains only that code.
Whenever I try to incorporate anything more that that code, it seems that the following code fails to “fire”.

After deciding the scope of the player while the player reaches someone: place the other party of the player in scope, but not its contents.

I’ve used the “rules” command to determine that the difference is only that the above failed to “fire”. All the other rules seem to be activated as expected. The net effect is that the program states that it can’t find the person that one is calling and move them into the players scope during the conversation.

Has anyone any ideas on what I could look at to see why the telephone code seems to be so capricious?

There is a known bug in the Four Cheeses example code. For the “supplying a missing second noun” activity to run, you need to include a truncated “understand” line; in this case the truncated understand line was left out, so supplying a missing second noun never runs, and the example code only happens to work because the phone is the only reasonable thing to try to make calls on anyway. There was more discussion here.

Anyway, if you add this line:

Understand "call [any known person]" as calling it by name on.

to Four Cheeses, then it’ll know that if the player types “call boss” (instead of “call boss on phone”) then it needs to run the supplying a missing second noun activity, which will let your rule run to pick the phone.

(BTW, you might want to look at this advice from zarf; if supplying a missing second/-- noun is going wonky, then you can always just define another action and redirect it to the one you want to happen.)

EDIT: Also, Four Cheeses has my favorite writing of any of the examples, though in practice I suppose it would have serious guess the topic problems.

Thanks, matt.

Tried adding the line, but the issue I noted still persists.
Where there any other changes to the example (that you know about)?
Any further areas I can check?

I haven’t added the code itself, because the phone code is basically right out of the documentation.
The only changes had to do with the message table, the name of the NPC and the addition of an every turn rule (for debugging) to show the location of the player and NPC.

Here is a snippet of the output with rules on, so that you can see what rules are firing.

[code]>call 1357
[Rule “Rule for supplying a missing second noun while calling something on” applies.]
(on the black telephone)

[Rule “Check calling it on” applies.]
[Rule “Carry out calling it on” applies.]
[Rule “After calling the white telephone on something for the first time” applies.]
“A+ Message Service. How may I help you?” asks Jane.

Player: By the window.
Jane: switchboard.

ask jane about message
You can’t see any such thing.

[/code]

Just a note to say:

  • The “Alias” example referenced in the manual seems to no longer exist. Was hoping to see another persons interpretation of how to address telephone conversations. Sometimes it helps me see why something doesn’t work.

  • I wonder how the “decide on scope” portion is intended to work? Somehow, I wonder if the issue is that the program is not able to decide the players scope at the time of assessing the rule or is not able to judge that a connection is in progress.

Hmm. Where is the white telephone? Are you sure Jane can see it?

Also, you might want to file a documentation bug pointing out that that section of the Reciple book refers to a nonexistent example.

Matt;

I went back and the telephoned extension.
It has the added line already included.
It worked when tested separately, so I then cut the code into my program.
Even with explicitly specified phone / person locations (except for the player), the code still can’t “see” Jane.
I’m starting to believe there is a collision going on that I’m not able to detect/see.

(P.S. I’ll have another look for the missing example, then log an issue if I can’t find it.)

Here are the relevant code sections:

Include Telephones by George Tryfonas.

[code]Book 7 - Telephones

The switchboard is a room.

The white phone is a telephone in the switchboard. The calling number of the white phone is 1357.

Jane is a woman in the switchboard. The owner of the white phone is Jane.

Before telling Jane about something:
try asking the noun about it instead.

Before answering Jane that something:
say “Best to confine your conversation to questions and answers.” instead.

Before asking Jane about something:
if the topic understood is a topic listed in the Table of Jane Conversation, say “[reply entry][paragraph break]” instead;
otherwise say “[The noun] does not reply.” instead.

After asking Jane about something:
if the topic understood is a topic listed in the Table of Jane Conversation:
if the clue entry is 1, record “Clue 2” as achieved.

Table of Jane Conversation
topic reply clue
“message/messages” “‘There was one call, sir. I remember it, because of the time.’, says Jane.” 0
“time/when” “‘At one, sir.’, replies Jane.” 1
“test” “‘This is a test, sir.’, replies Jane.” 1

Table of Misdialled Numbers (continued)
number retort
1471 “The number that last called you is not available.”
999 “In this country, making prank calls to the police is frowned upon.”
[/code]

Book 5 - Far Wall (Room) The far wall is a room. "An old wooden desk desk stands here. The window behind it is opaque with years of dust.". The far wall is north of the centre. The printed name of the far wall is "By the window".

[code]Part 2 - Black Telephone
The black phone is a telephone which is scenery in the far wall. The description of the black phone is “A black phone sits on the desk. It’s a pretty typical 1950’s style rotary dial model. You notice that the phone number, which one usually sees in the centre of the dial, is missing. This guy must really be paranoid!”.

Before examining the black phone when Vorple is supported:
display image “Telephone.jpg”, centered.
[/code]

Here is the output of the full-up program:

[code]Menu:
(type one of the following)

  1. About
  2. Credits
  3. Introduction
  4. Play

4
The entrance
You are standing in the entrance of a detectives office. The office is obviously old and dust lies everywhere. Here, it seems, you have found your mark: file-boxes line the left wall, a dark carpet lies on the floor in the centre of the room, and an old record player sits on a side-table against the right wall. The thing you were specifically told to look for, an old desk with three drawers, sits by the window against the far wall.

You can see some winged sneakers (in which is a canister) here.

f

The centre of the office
You are standing on a once beautiful old carpet with a peculiar motif. Strange … It’s not what you would have expected in a detectives office.

Player: The centre of the office.
Jane: switchboard.

f

By the window
An old wooden desk desk stands here. The window behind it is opaque with years of dust.

A battered old desk. The years have not been kind, and it has cracked and split in several places; the veneer is lifting and badly damaged. But, it is still a sound piece, and features three drawers.

On the desk are a desk blotter, a pen, a card, a nickel, a coffee cup (in which are a thick black fluid and a cigar tube) and a wooden egg.

Player: By the window.
Jane: switchboard.

ask jane about test
You can’t see any such thing.

[/code]

Finally figured out the issue:

I kept commenting out sections until it worked.
I found that I had inadvertently use “record player” as an object name.
The system must have not correctly sensed “record player” as the full name and used only “player”.
When it went to decide scope, it confused an object and the player.

The following now works, in that it allows one to converse with “Jane”.

[code]“Try Phones” by Gary Gauthier

Include Telephones by George Tryfonas.

Section 1 - The far wall

The far wall is a room.

The player carries a piece of paper. The description of the paper is “On the piece of paper, in your handwriting, is written: ‘Jane: 1357’”.

The black phone is a telephone which is scenery in the far wall. The description of the black phone is “A black phone sits on the desk. It’s a pretty typical 1950’s style rotary dial model. You notice that the phone number, which one usually sees in the centre of the dial, is missing. This guy must really be paranoid!”.

Section 2 - The switchboard

Jane is a man. The white phone is a telephone. The calling number of the white phone is 1357. The owner of the white phone is Jane.

Before telling Jane about something:
try asking the noun about it instead.

Before answering Jane that something:
say “Best to confine your conversation to questions and answers.” instead.

Before asking Jane about something:
if the topic understood is a topic listed in the Table of Jane Conversation, say “[reply entry][paragraph break]” instead;
otherwise say “[The noun] does not reply.” instead.

Table of Jane Conversation
topic reply clue
“message/messages” “‘There was one call, sir. I remember it, because of the time.’, says Jane.” 0
“time/when” “‘At one, sir.’, replies Jane.” 1

Table of Misdialled Numbers (continued)
number retort
1471 “The number that last called you is not available.”
999 “In this country, making prank calls to the police is frowned upon.”

Part 2 - Record-player

The side-table is a supporter. [debugging]

The record-player is a fixed in place device on the side-table. The record-player is switched off.

Understand “turntable/phonograph” as a record-player.

Instead of examining the record-player for the first time:
say “Not the sort of thing you see every day. It is even older that than the ones you remember as a kid. It only plays the old 78’s.”.

Instead of examining the record-player for more than one time:
say “[if switched off]You notice that there is a record on it. The record is a classic, ‘Music Music Music! by Teresa Brewer’[otherwise]The record is spinning to fast to read the label[end if].”;

After switching on the record-player:
say “You turn on the record-player. The platter of the record-player starts to rotate slowly. As the tone are settles on the record, the music begins to play, ‘Put another nickel in, in’ …”.

After switching off the record-player:
say “You turn off the record-player. As the tone arm of record-player returns to its cradle, the music ceases and the platter coasts slowly to a stop.”.
[/code]

Oh yeah, objects with “player” in their name cause really annoying and hard to detect bugs. Glad you found it!

That is the worst - I hit the same issue with a CD player last year. Glad you figured it out!

I’m going to uservoice this, I think.

ETA: No wait, it’s already filed as a bug.

Thanks for the note, matt. I’m not all that familiar with the bug reporting system yet. Happy it’s been logged. It’s a nasty bug, but mostly because one wouldn’t think of looking at the names unless you already knew the issue existed.