Suppressing the printed name of a room

Hey all-
I want to temporarily suppress the printed name of a room so that players don’t miss the before-they-enter-a-room text.
I have this code:

Check going to the Kitchen:
	say "As you enter the kitchen, the dog jumps on you, getting drool all over your dress.";
	now the printed name of Kitchen is "";
	kitchenname returns in zero turns from now;
    continue the action.

At the time when kitchenname returns:
    now the printed name of the Kitchen is "Kitchen".

This works great, but it’s creating an extra space in the text where the missing name is, and that’s peeving testers. I tried making rooms privately-named, but that didn’t work. Is there any other way to do this? I’ve been searching the documentation, but can’t find anything else.

1 Like

Hmm, tricky! The heading is printed out by the room description heading rule, but I don’t think you can say “the room description heading rule does nothing when going to the kitchen” because the new room’s description is being printed out by the end-of-turn housekeeping rules, after the going action has resolved. Similarly, “the room description heading rule does nothing when the location is the kitchen” doesn’t work since then the player won’t know where they are when typing LOOK.

Based on that, the best I can come up with is a bit of a kludge, but I’m sure someone cleverer than me will have an elegant answer soon!

(NB if this is happening multiple times in your game, which I think it might be, you can rename “kitchenname” to something more generic – you shouldn’t need multiple versions of the statement knocking out the heading rule).

(Also I’m chewing over replying to your PM, but that’s a harder question!)

The room description heading rule does nothing when kitchenname is false.

kitchenname is a truth state that varies.

Check going to the Kitchen:
	say "As you enter the kitchen, the dog jumps on you, getting drool all over your dress.";
	now kitchenname is false;
	kitchenname returns in zero turns from now.
	
At the time when kitchenname returns:
	now kitchenname is true.
2 Likes

Ayup. That’s great. And since truth states were almost next on my list to learn, this is good timing. I’ve been going through the standard rules, and there are a lot of them to learn. I sort of feel like a deer in headlights with them and didn’t know where to start, so this is as good a place as any.
Thanks a million as always!

1 Like

Glad it’s helpful for figuring out truth states too! Honestly they’re probably seeming more complex than they actually are - they’re just the world’s simplest variables, way easier to work with than tables and other stuff you’re already digging into.

Here’s a stab at a generic solution that will probably fail for some imaginable circumstance 'cause it’s mucking in complicated things…

A room has a text called the initial-entry.

Lab is a room. "Standard mad scientist affair."

Kitchen is east of Lab. "Avocado green from the seventies."
The initial-entry of the Kitchen is "As you enter the kitchen, the dog jumps on you, getting drool all over your dress.";

Conservatory is north of Lab. "You can feel the conservation."

The room description heading rule does nothing when print-room-heading is false.

To output abbreviated room description: (- AbbreviatedRoomDescription(); -)

print-room-heading is initially true.

The describe room gone into rule does nothing when the player is the actor.

Report going (this is the player going rule):
  if the room gone to is not visited and the initial-entry of the room gone to is not empty begin;
   say the initial-entry of the room gone to;
   say paragraph break;
    now print-room-heading is false;
  end if;
  output abbreviated room description;
  now print-room-heading is true.
1 Like