In my game, there are two rooms that are of interest in this question - let’s call them the Park and the House. The Park is southwest of the House. The player is able to move freely between the Park and the House up until the point where a character casts a magic spell in the Park that makes it look like the player can still go northeast to the House. But when they go northeast, they actually go into a new room that wasn’t there before. Once they’ve solved the puzzle in that room, they can go northeast again and reach the House. The “new room” disappears and is never seen again. The player can once again move freely between the Park and the House.
So…I’m not sure how to create and interpose that room in the middle of play. I’m rewriting this game from where I started it in Quest, and I had it working there, but while Inform is amazingly intuitive in many ways, I’m finding some roadblocks where I’m used to doing things like setting flags on objects.
Any help would be much appreciated. Thank you!
I figured out what I think is kind of a kludgy way to do this:
Joe is a man. Joe is in the park.
The Park is a room. The House is a room. The Park is southwest of The House.
Puzzle is a room. Exit is a room. Exit is northeast of Puzzle.
Phantom Zone is a room.
Instead of going northeast when Joe is in The Park:
Move player to Puzzle.
Instead of going northeast when the player has <met whatever the puzzle condition will be>:
Move Joe to Phantom Zone; move player to The House.
There has to be a more elegant way to do this, though, right?
See The Recipe Book §8.2. Ships, Trains and Elevators
Example “The Unbuttoned Elevator Affair” - specifically
After going to the Secret Elevator:
say "The doors automatically close, there is a rush of motion, and they open again.";
if UNCLE Headquarters is mapped west of the Secret Elevator, now Del Floria's Tailor Shop is mapped west of the Secret Elevator;
otherwise now UNCLE Headquarters is mapped west of the Secret Elevator;
continue the action.
You don’t need to create or destroy the room during play, just create it and change map connections as necessary when the player needs to access it.
Ok, that makes sense. Thanks a lot - I knew there was a better way!
I have used the example “All Roads Lead To Mars” as a basis to create some interesting dynamic room configurations. It lets a player ‘wander’ in any direction they like and modifies the map as the player moves to ensure they arrive at the each location in the map regardless of the route taken. The “All Roads Lead To Mars” example is here (bottom of page): http://inform7.com/book/WI_6_14.html#
I also found the example “Bee Chambers” helpful in understanding how to establish randomized connections between rooms. That example is here: http://inform7.com/book/WI_8_11.html#e27
Thank you - that’s very helpful. I’ll be sure to check that out.