Get To Last Room

Shadowalker
31 Dec 2004, 01:24
I was wondering if there was an option to take the player to the last room that they were in. For example, I have a flashlight, and if the player drops it, I move them to "Dark Room" where they can't move unless they pick it up again. I want that if they pick up the flashlight, it will move them back to the last room that they were in. (In QDK please) Thanks

007bond
31 Dec 2004, 08:21
I don't think so. You'll probably have to store it in a variable.

Alex
31 Dec 2004, 12:21
What you want to do is, when the player drops the flashlight:

- store the current room in a variable, for example "oldroom". Set this to #quest.currentroom#
- move them to the dark room.

Then when the player picks up the flashlight, move them to #oldroom#

007bond
31 Dec 2004, 20:57
Yeah, that's sort of what I suggested.

Oh, and Alex, good to see you back. Where have you been?

Shadowalker
02 Jan 2005, 08:15
Hi Alex: Well, I'm not quite sure how to do what you suggested. I did that when the player "drops" the flashlight, set a variable "oldroom," and variable contents are "#quest.currentroom#." And move the player to "darkroom." Then, when player picks up the flashlight, (if #quest.currentroom# = darkroom, of course) then I tried two things. I tried, move player to room, #oldroom#, which didn't work. I can see why, as #oldroom# is a variable, not a room, but it contains #quest.currenroom#, so how to I make it take you there? I also did "take player to room #quest.currentroom#," but that didn't either work. How to I implement what you said in your earlier posting? Thanks

Alex
03 Jan 2005, 23:40
Here's a primitive demo of what I mean. You can save this in Notepad as an ASL file and open it in QDK:


define game <>
asl-version <350>
gametype singleplayer
start <start>
game info <Created with QDK Pro 3.52>
end define

define synonyms
end define

define room <start>
south <other>

define object <flashlight>
take {
give <flashlight>
if ( #quest.currentroom# = dark ) then goto <#oldroom#>
}
drop {
msg <You drop the torch.>
set string <oldroom; #quest.currentroom#>
goto <dark>
lose <flashlight>
}
end define

end define

define room <dark>
end define

define room <other>
north <start>
end define

Shadowalker
04 Jan 2005, 22:32
Thanks. I'll try it.

Shadowalker
09 Jan 2005, 07:23
Cool, thanks!! That's awesome! I didn't know that you could do things like that. (Save the current room as a variable.) There are probably a ton of other things I still don't know about Quest/QDK. You should write a cool tricks n' tips guide, Alex.

francisstokes
20 Feb 2005, 20:45
Ok,i know that this is an old thread but couldnt you just make a script in QDK so when the player drops the torch print bfsdkbf|w then move them to the Dark room.Have a copy of the torch in the Dark room and make the old torch inaccessable.when they pick up the torch they are sent back to the light room.
I know that this sounds complicated,but its really easy once you go to script it.Thats just me,though.

Shadowalker
21 Feb 2005, 09:25
Well, the thing is, the "light room" could be any room. By scripting a code the way you mentioned, how would it know what the last room you were in was? Unless I'm misunderstanding what you mean.