Moving/Hiding Doors

I’m trying to create a door that appears after the player activates a certain mechanism. The two things I’ve tried are:

  1. Moving the door to the room when the mechanism is activated, with something like:
Room 1 is a room. The machine is a device in Room 1.
Room 2 is a room. The wooden door is north of Room 2.
After switching on the machine:
    say "A wooden door appears to the south.";
    now the wooden door is mapped south of Room 1;

This results in “You can’t reach into the field”, which I don’t understand, partially because I don’t really understand how “now the … is mapped [direction] of [room]” works, and it seems like it’s supposed to be used with rooms, not doors.

  1. Making the door closed, unopenable, and not allowing the player to do actions to it, with something like:
Room 1 is a room. The machine is a device in Room 1.
Room 2 is a room.
The wooden door is a closed unopenable door. It is north of Room 2 and south of Room 1.
Instead of doing something to the wooden door when the wooden door is unopenable, say "You can't see any such thing."
After switching on the machine:
    say "A wooden door appears to the south.";
    now the wooden door is openable;

This is very finicky since the door is still there, and I can’t figure out any way for it to work on verbs with multiple objects (“put [thing] on door” still results in “putting things on the wooden door would achieve nothing” - I’ve had this problem with many things that I would like to make interaction with unlikely/impossible). Ideally I’d like to remove it from the scope until it’s discovered, but as far as I can tell there’s not any way to remove things from the scope…?

Thanks for any help!

Unfortunately, Inform does not allow doors to be moved. Is it important that there actually be a door object there, and is it important that this door actually join two adjacent rooms?

Make a fake door!

The wooddoor is in Room 2.
The printed name of wooddoor is "wooden door".
Understand "wood", "wooden", "door" as wooddoor.

After switching on a machine:
     say "A wooden door appears to the south.";
     now the wooddoor is in room 1.

You have to do some opening and closing commands, etc for the fake door so it will behave correctly, but you can move it wherever you like and do whatever you want with it.

3 Likes

Yeah, that works! It’s certainly more work than it feels like it should be (and I’m still annoyed there’s no clear way to say “instead of doing something to an object” that includes two-noun verbs), but it functions! Thanks!

1 Like
lab is a room.
parlor is a room.
secret door is a privately-named undescribed door.
does the player mean doing anything with the secret door when the secret door is undescribed: it is very unlikely.
the secret door is north of the lab.
the parlor is north of the secret door.
understand "secret", "door" as the secret door when the secret door is described.
The switch is a thing in the lab.
the switch can be switched on.
carry out switching on the switch when the secret door is not described: now the secret door is described.
last report switching on the switch when the secret door was not described: say "You see a secret door to the north."

I wish I’d known about it sooner. I find it essential to master it, particularly in relation to secret passages, hidden doors, objects that suddenly behave like doors, and those that are door-like waypoints once they’ve been examined/moved/transformed/etc.

I’ve come to use ‘real’ doors only in very specific cases: the door is obvious, and we have to open or close it. Mainly for scope reasons. What’s more, it’s impossible during the game to create a map-link between a room and a door, whereas it is possible (in both unidirectional or bidirectional ways) between two rooms (between which, for example, you’ll have a fake door like a sliding bookcase when you push the fifth volume of the infernal encyclopaedia).

1 Like

Yeah, it was just mind-blowing when I realized I didn’t have to put up with all the exasperating and rigid baked-in qualities of Inform doors. I never use “real” doors anymore either.

3 Likes

If you’re using fake doors a lot, @Draconis helped me make an extension in the library called “Easy Doors”.

3 Likes