Changing rooms on exit enterable container - Why?

Hi,

I am really new at Inform 7 but trying to learn. So I created a bunch of the rooms in the game I am trying to create and then started on the stuff inside the first one. I made a table with an enterable container attached called the “bench”. It is a picnic table. Whenever I sit on the bench and then stand up again it sends me out the door of the room and in to an adjacent room. It is as if I have both typed “stand up” and “north” but I have only done the first of these.

Any ideas why this might happen.

Thanks,

Kate

Can you show us the code you’re using?

OK. Here is the code with some of my comments redacted just so they don’t fill up space.

[code]Chapter 1 - Intro Station

The Cocina is a room. Outside from the Cocina is the Outside Cocina. The description of the Cocina is “[first time]You are in the Cocina where all meals are served. [only] The small room contains a long rustic picnic table made of dark wood, the surface polished from long use. It fills most of the available space. The wooden walls were probably once all white but paint has been worn away on the edges of the boards revealing the dark wood beneath. The wooden part of the walls only reaches 1/2 way to the roofline. The open section above this is covered by chain link and screening presumably to keep out hungry animals both small and large. On the east side of the room a short chest high counter starts about half way across the room acting as a sort of buffet during meals. A swinging door at the end of the counter discourages diners from intruding on the cook in the cooking area. A screen door leads outside to the north.”

Instead of touching the table, say “The boards of the table are somewhat uneven and feel smooth and faintly sticky.”

In the Cocina is a long table. A container called the bench is part of the long table. The bench is enterable. The long table is scenery. [not described independently of room] On it is a salt shaker, pepper shaker, bottle of hot sauce, jar of pickled vegetables.

Instead of entering the bench, say “You sit down at the table.”
Understand “sit at [something]” as entering.
Understand “sit down at [something]” as entering.

[why do I move north when I type stand up when sitting at table]

The description of the long table is “This is a rustic picnic table with benches attached along both sides.”

In the Cocina is a counter. The counter is a supporter. The counter is scenery. On it is a bean tray, rice tray, insulated water cooler.

The bean tray is a container.
The rice tray is a container.

The Outside Cocina is a room. South of the Outside Cocina is the screen door.

The screen door is north of the Cocina and south of the Outside Cocina. The screen door is a door. The screen door is scenery.

The description of the screen door is “The screen door is covered in chain link and screening just like the windows of the Cocina.”

The Tool Shed is a room. South of the Tool Shed is the Outside Cocina.

The Back of Station is a room. East of the Back of Station is a room called Outside Cocina.
Inside from the Back of Station is the Small Museum.[/code]

The code continues but just to describe more rooms which have nothing to do with this area.

Thanks,

Kate

This line completely replaces the standard entering action. So the command ENTER BENCH (or SIT AT BENCH) prints your message, but it doesn’t actually leave you sitting down. Then the command STAND UP triggers the exiting action (this is a normal thing in the library) which means you walk outside.

You want something like

Report entering the bench:
    say "You sit down at the table."

This modifies the report but not the carry-out part of the action.

Thanks for your help. I was misunderstanding “Instead”. I was trying to get the output to be “You sit down at the table.” instead of “You enter the bench.” I will go check out the documentation and see if I can supress it somehow.

I was hoping to just allow the user to type “sit at table” or “sit down at table” but actually have them enter the bench.

Thanks again,

Kate

Adding the rule above leads the interpreter to say both “You sit down at the table.” and “You get onto the bench.”, because report rules aren’t exclusive. One solution in this case is to stop the entering the bench action after you output the one message you want:

Report entering the bench: say "You sit down at the table."; stop the action.

This might cause trouble later if you add more report rules that can apply to the bench, since the action will stop immediately after the first message. In the example below, the player wouldn’t be told about the sticky bench:

A thing can be sticky. The bench is sticky. Report entering a sticky supporter: say "Eww, [the noun] is sticky."

The most common way to change a response in a specific case like this is an After rule, which blocks the Report rules from running.

For what it’s worth, here’s a flowchart of when the six basic kinds of action rules kick in.

minimal-rules-chart.png
[Edit: that was huge, sorry; rescaled.]