Locked doors/rooms

bgreen58
04 Jan 2005, 17:51
There must be an easy way to do this, but I'm having a heck of a time figuring it out. I'm trying to set up a room that is easily accesible for the player to enter the first time, but locks as soon as he enters. He has to find and use a key to exit.
I'll admit, I'm a newbie, and this sounds like a pretty standard task for a game, but ARGHH! :oops:

Shadowalker
04 Jan 2005, 18:55
Hi there. That's fine; That's what these forums are for. I'm pretty new myself. Anyway, here's what you can do. I don't know how you set up that the player opens the door, but let's say that you have that the player types "open door." You do, (I'm talking QDK here) IF flag door1 (for exe) is NOT set, the print "You can not exit unless you have the key." Then do ELSE if flag door1 is set AND player has item "key", move player to room "(whatever room you want).
**I'm in a rush while I'm typing this, so I might be leaving something out. I'll check it later and go over it.

steve the gaming guy
04 Jan 2005, 18:59
You beat me to it Ebayfan...

Here's my thought. You have two rooms. Room 1 if you go north (or wherever you choose) it takes you to Room 2. If you try to go south back to Room 1, you include a script where it checks if player has a key. If so, move the player south; otherwise say "The door is locked"

Make sense?

bgreen58
04 Jan 2005, 21:18
Thanks for your help. That's exactly what I ended up doing. I didn't realize I could put in a script on the compass page, so I put one in that checked to see of the player had the key when he tried to leave the room.

Shadowalker
04 Jan 2005, 22:17
Yeah, I guess Steve's way makes more sense. It's just that I usually put a door at the end of certain rooms, instead of just letting you "go north." But if you are doing it that way, then putting a script by the compass does make it a lot easier...

paul_one
05 Jan 2005, 22:52
Personally I'd have a room with no exit south. Then, if the player has the key/uses the key, create the exit.
But to each his own.

steve the gaming guy
06 Jan 2005, 18:49
Computer Whizz wrote:Personally I'd have a room with no exit south. Then, if the player has the key/uses the key, create the exit.
But to each his own.

Sure, creating exits work too! In fact, the game that I just completed and uploaded to Alex has a "creating" exit towards the end of the game. A snake is blocking your path in one direction and when you find a way to scare it, it moves out of the way creating an exit.

On a side note, maybe if you were making an action game, you could kick the door in or something.