Making a revolving door that provides access to different parts of a room

I’m trying to make a game that includes and escape room. In one room of the escape room, I want a big glass revolving door that cuts off most of the room, and you have to enter it, pushing it around to access each of the four segments one at a time.

Can you think of any convenient ways of coding this? My current plan is to make 3 or 4 transparent containers and put everything in the room into one of them, and pushing the door opens one container and closes the others, so you can reach into only one at a time. But then I’m not sure how to model the area outside of the door or on the floor of the door itself.

So I guess I’m kind of fishing for inspiration. If that’s annoying I apologize!

Edit: and I’m thinking of the beach ball puzzle from Curses! here, but that implemented things differently since there was only 1 item in the door area

2 Likes

Are you planning to make it so the player can/needs to drop stuff in different sections of the revolving door? If not (and it seems like you could disallow putting stuff into the door by saying that might jam the mechanism) seems like you could just implement as an enterable backdrop in four rooms (either with an “instead of entering the revolving door” rule or making a container part of the backdrop) and just move the player one room clockwise when they enter/push it.

3 Likes

Hmm that’s actually pretty clever! For aesthetic purposes I’d like to make it one room, but I wonder if I could fake that by making the four sub-rooms have similar names and somehow making things in the other rooms visible.

2 Likes

Oh no, that would mean messing with scope! :slight_smile:

I think making the objects visible isn’t too too bad though - these examples seem simple at least?

https://ganelson.github.io/inform-website/book/WI_18_29.html

2 Likes

I think it comes down to what you want to be able to reach and to see from each area.

If you should be able to see into all areas (so that all things in the door area and each of the 4 containers are always in scope, but not necessarily touchable) but just reach into one at a time, then the natural implementation is that the door itself is the room and it has 4 transparent enterable containers in it only one of which is open at a time.

The player will need to be put in one of the containers on arrival, from which they exit to the room (i.e. the rotating door).

Stuff on the floor of the door moves with the player as the door rotates, i.e. stays in the room, so doesn’t need a particular implementation.

4 Likes

Oh, that’s nice! I didn’t think of that feature.

1 Like

I’d been thinking: have the door be a single transparent open enterable container and then move it from one room to the next room when it revolves.

When the player’s in the door, put all four rooms’ contents in scope; when the player’s in a room adjacent to the revolving door, put the contents of the room opposite it in scope.

Have a reaching inside a room rule that denies access to anything not in the current location.

…and I think that might cover it.

Making the revolving door the room and the rooms enterable containers might be easier, but I think I’d have to try them both before I could really tell.

3 Likes

It has the attraction that it requires no scope or reach hacking, imho.

2 Likes

While that’s an obvious attraction, it would require a bunch of fiddling with the looking-related activities to get all the details right. It seems imaginable to me that that could ultimately prove to be more complicated. But like I said, I don’t know; I’d only feel sure about it in hindsight.

2 Likes

I think the single container moving among four rooms approach didn’t turn out badly.

4 Likes

Maybe you’d want to have you be in the revolving door, or something, because it’s telling me that the ducky is in in the door, also the woolly mammoth and the urn stay in the room. Finally, it could be complicated (I don’t use Inform 7) but maybe dropping anything here moves it to the door (you should be in that, right?) And the fact that PUSH DOOR N/S/E/W could work.

Woah! Why I am I talking? I don’t even use Inform 7. Nice though! :melting_face:

1 Like

This is a demonstration of the technique, not intended to be at game level of polish. The things you describe are all intended behavior: this is a four-wedge glass revolving door connecting 4 rooms. You, the player may be in the door, or in one of the rooms while outside of the door. Anything on the floor of the door (like the rubber duck begins) is moved along as the door turns, thus remaining with the player. To keep the demo simple, I created one new command revolve to move the door, leaving how turn, rotate, move, push might be used to MathBrush.

4 Likes

Aha! I had envisioned all the dividing walls being glass.

Warning- ugly rapid-fire coding upcoming…

3 Likes