Dream Sequence

Hi, Everyone!

I’m trying to figure out some way to implement a dream sequence with Inform7, and some of the related examples I’ve seen in the Recipe Book and elsewhere seem overly complicated and hard to interpret and pick apart to modify for what I want to do.

I would like to simply let the player choose to go to sleep, and if they’re in the bedroom, they fall asleep on the bed and then they enter a dream sequence.

While asleep, the game moves them to another series of rooms (a dream world) disconnected from the main game. And you can explore the area, take things, do everything else, ect., but then when they pick up a certain object, it wakes them up, and they find themselves back in their bedroom. And then they have the object they picked up in their dream in their inventory.

If somebody knows a simple, easy way to implement this and would be willing to share it or point me in the right direction it would be much appreciated!


Example 158 “Space Patrol - Stranded on Jupiter!” illustrates one way to handle it.

Another way would be to switch the player to a different character, one who is already set up in the dream world:

(not tested):

[code]Dream Sequence is a scene. Dream sequence begins when sleeping in the bedroom.

When dream sequence begins:
Now the player is dream-walker.

Dream-World is a room. Dream-walker is a man in Dream-World.[/code]

Switching to a different character is definitely the way to go, IMO. Otherwise you have the hassle of all the stuff the player is carrying (unless you want the player to have all his/her items in the dream).

You can end the scene with “Dream sequence ends when the player has [the item].”