Previous Room Function

fs16
03 Jan 2007, 18:29
Hi,
I had a look through the help files but i didn't see anything on it. Is there a function for obtaining the previous room.

Thanks for any replies,
Frank

Arbutus
03 Jan 2007, 20:27
Quest doesn't have a built-in variable for the last room but it is easy to make one. Quest does have a built-in variable called quest.currentroom. For more built-in variables, see http://www.axeuk.com/quest/developer/asl/script-strings.htm

Here's an example that saves the current room in a variable called quest.lastroom before each turn. For feedback, it displays the last room after each turn but you can remove that after testing.

	beforeturn set string <quest.lastroom; #quest.currentroom#>
afterturn msg <Last Room was #quest.lastroom#.>


In QDK, beforeturn and afterturn are set in the Game Properties window. See http://www.axeuk.com/quest/developer/asl/qdk-game.htm for more on Game Properties.

fs16
04 Jan 2007, 16:52
Yeah i just figured that out. Thanks.