I’ve created a ‘going by name’ action as demonstrated in examples 306 and 307 of the recipe book (code below), and it works great. However, it becomes a bit much to play after a while, as the game prints the name and description of each room the player passes through to get to their final destination.
Is there a way I can either:
- Use a temporary list of rooms to say something like “you make your way through the W, X and Y, ending up in… z”
- Or just have it print the names of the rooms without their descriptions and contents.
I feel like this should be possible, but it’s a bit beyond my skill level. I realize that most of this command is still handled by the going action, and it is that which is causing all of this extra information to be printed.
I also wonder if there is another way of doing this that doesn’t require a loop.
Suggestions, other threads, or examples from the book are welcome. Thanks.
Include Locksmith by Emily Short.
Going by name is an action applying to one thing.
Understand "[any room]" as going by name.
Understand "go to/-- [any room]" as going by name.
Understand "[door]" as entering.
Check going by name (this is the can't go to the location rule):
if the noun is the location:
say "You are already there." instead.
Check going by name (this is the can't go to unvisited rooms rule):
if the noun is not adjacent and the noun is unvisited:
say "That noun did not make sense in this context." instead.
Carry out going by name:
while the player is not in the noun:
let that way be the best route from the location to the noun, using even locked doors;
let destination be the room that way from the location;
if that way is not a direction:
say "You aren't sure how to get there from here." instead;
try going that way;
if the player is not in the destination, rule fails.