Have 'enter [room]' act the same as 'go inside'?

I have a room ‘field’, and inside from it I have a room ‘barn’. The player can use ‘go inside’ to go from the field to the barn, but ‘enter barn’–which seems like the most obvious way to go about it–doesn’t work, because ‘enter’ only works for enterable containers, not rooms. How can I make both mean the same thing?

1 Like

You probably have a barn object in the room as well, for the player to examine and otherwise interact with? What you can do is to redirect the player’s attempt to enter this object to a go inside action. Here’s a very barebones version that should work:

The barn is in the Field. "A big red barn is here."

In-barn is inside from the Field. The printed name is "In The Barn".

Instead of trying entering the barn:
	try going inside.

There are a few variations on how to do this! I haven’t made the barn object enterable here. That’s why that instead rule is “trying to enter the barn” – the player can’t actually enter it. But trying to do so triggers trying the “go inside” action instead.

I’ve also named the room “In-barn” because things can get very confusing with both barn objects and barn rooms in the code! I personally like one word names for things so I use dashes, but you don’t have to.

3 Likes

(I should add: I think it is possible to to make it so you can “enter” a room from a neighboring room but it would require adjusting how rooms and travel work, and I always use the most built-in-to-Inform solution I can think of!)

3 Likes