Doors, Keys, and Goto

Alf
13 Jan 2004, 19:36
Hi, Everybody

I want to implement a room with a locked door requiring a key. How do I do this?

How about a room with a closed (but not locked) door?

My game has a front door, and the user has the key. But I don't know how to implement the interaction of the key to the door.

Also, is there any way to "call" one game from the other? Probably doesn't make sense, huh? If I have a complete game, maybe with "Chapter 1" being an adventure. Then, upon completion of that game, allow the user to start "Chapter 2" without exiting the runtime.

If it's a dumb idea, you can say so. I won't mind.

Thanks in advance! - Alf

Cryophile
13 Jan 2004, 19:58
Why not use a flag? Do a conditional to check if the doorobj has a flag called 'locked'. If the door is 'locked' but the message in the then, as you know.
Make sure to add the 'flag on <locked>' to the procedure when you lock the door. Also, add the 'flag off <locked>' to the procedure when you unlock the door.

Your second question:
Not unless you can save variables to files in the new Quest version. I haven't got it yet... I only use the internet at school.

Any other questions

Anonymous
13 Jan 2004, 23:53
For directional: Make it run script:

If:
Flag is set "Door Unlocked"

Then:
Print "You open the unlocked door and go in."
move player to room "past door(or whatever)"

Else:
run procedure "Key"


Procedure "Key" is:

If:
Player has object "Key"

Then:
Print "The key unlocks the door."
set flag "Door Unlocked" to on.

Else:
print "The door is locked!"

For go to: Not sure. :?:

Alf
14 Jan 2004, 12:43
Thank you both for the help. I'm still trying to learn when/where/how on scripts, so I'll try these ideas.

As for the Goto, maybe the Creator (Quest creator, that is) can think about this one. I could see its benefit whenever you would want to make a chapter-based or serial game, perhaps not allowing the player to move to the next level before completing the preceeding one. Or where gameplay will be determined by variables set previously. This would also give you an extra "dimension" for more complex scenarios. Implementation could be as simple as a Quest-readable file.

Yea, it's great to have all these smart ideas when on the outside lookin' in, huh? When Alex sends me an email full of daggers I'll get the hint:-)

Any thoughts?

Thanks again!

Alf

iamdaman13
14 Jan 2004, 14:01
Thanks, Jordan. That door unlock code you gave Alf really helped me. I was having a similar problem. Thanks, Alf, for bring up this topic, as I never thought about doing it myself. I kept wasting time trying to figure it out myself. Both of you have been a big help. Thanks. :D