Axe Software Forums
  Quest Developer Forum
  Gotta question


Author Topic:   Gotta question
Pikaflare posted 14-09-2001 00:22 GMT     
How do I check if there is an item in a certain room. I want to move the player to that room, check if it's there, and move the player back to the room he was in. I just don't know how to move the player back to the room he was in. Can someone help me?
Maxpowr
passerby posted 14-09-2001 12:33 GMT          
well it turns out that moving the player back is really, really easy. (The following is based on QDK).

create a string variable (lets call it 'previousRoom'). Just before you actually move the player, put the '#quest.currentroom#' value into '#previousRoom#'.

You now have it stored, so then you move the player do whatever you want, then when you're done, issue the 'move player to new room' command and give it the '#previousRoom#' value.

You will now be back where you started. Just remember that if you don't want the process to be seen by the player, you need to turn off the text output before you start and turn it on again afterwards.


passerby

passerby posted 14-09-2001 12:34 GMT          
well it turns out that moving the player back is really, really easy. (The following is based on QDK).

create a string variable (lets call it 'previousRoom'). Just before you actually move the player, put the '#quest.currentroom#' value into '#previousRoom#'.

You now have it stored, so then you move the player do whatever you want, then when you're done, issue the 'move player to new room' command and give it the '#previousRoom#' value.

You will now be back where you started. Just remember that if you don't want the process to be seen by the player, you need to turn off the text output before you start and turn it on again afterwards.


passerby.

passerby posted 14-09-2001 16:04 GMT          
please excuse the double posting. I hit the button again, after it didn't appear the first time.
Pikaflare posted 14-09-2001 16:30 GMT          
Great. Thanks a lot!
Maxpowr
Alex posted 14-09-2001 17:25 GMT          
A much simpler and more elegant solution would be to use the $locationof(...)$ function.
passerby posted 17-09-2001 15:34 GMT          
Yes, that would be even better wouldn't it - you could put all the code for moving the player, doing whatever, and then moving them back into one procedure, and simply the process. Or have two procedures (one to go to the new room and one to return) if they want to have the player able to return based on some condition.