Storing player location

Hey folks,
long time tinkerer, first time Inform 7 user here.

Having played around with I7 for a little while I seem to have hit a wall.

The player goes on a … spiritual journey, which may be initiated in ANY room in the game, which transports the player to a maze of rooms. Once at the end of the maze, aka enlightenment, the player is transported back to the location s/he was in when s/he started the journey… My problem is that I do not know how to create an exit which stores the location of the player and allows them to use it to return to it…

Now I get how to create the custom command to send the player there, works perfectly too, but the return journey is the problem.

I hope someone here can help me. :neutral_face:

You can use a global variable for this. Something like…

[code][define the variable:]
The journey starting point is a room that varies.

[save the player’s old location when they start the journey:]
Instead of xyzzying:
change the journey starting point to the location; [<–]
move the player to the first maze room.

[send the player back when they exit the maze:]
After going to the final maze room:
move the player to the journey starting point.[/code]

Thank you so much, that worked. :smiley:
Can hardly believe I spent so much time trying to get it right and it was such a simple line.