Get To Last Room

Shadowalker
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
I don't think so. You'll probably have to store it in a variable.

Alex
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
Yeah, that's sort of what I suggested.

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

Shadowalker
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
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
Thanks. I'll try it.

Shadowalker
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
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
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.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums