Door and Key

Posted by Zelfius on Thu 15 Jul 2004 05:10 PM — 5 posts, 21,589 views.

#0
Smaug Codebase

In Area Editor I can't figure out how to create a door or gate that would only have one key to unlock it. How do create the door and how do you create the only key that can unlock that door? Thanks
Australia Forum Administrator #1
Create the key

  • Make a new object, with an appropriate name and description
  • Make the object type "key"
  • Give it a wear flag of "take", so it can be picked up


Arrange for the player to get the key somehow, eg. use a reset to put it into a room somewhere.



Make the exit

In the room where you want the key to work, select the appropriate exit (eg. North). Edit that exit, and ...

  • Click on the "choose key" button. Use the "choose objects of type ..." combo box, to choose "key". Then only keys will be listed. Choose your new key.
  • Make sure you have the following exit flags:

    • Closed (so it needs to be opened)
    • Locked (so you need a key)
    • IsDoor (otherwise you can't use a key on it)



That's it! The key should now be the only thing that unlocks that door.
Amended on Fri 16 Jul 2004 03:13 AM by Nick Gammon
#2
The only flags I have for exits is isdoor, pickproof, and nopass. I put all those flags on each of the exits and there is still no door. What should I do?

Thanks for your time and help.
Australia Forum Administrator #3
The default flags for the unregistered version may not agree with your MUD's definition. With registered copies of Area Editor you can process the smaugconfig.dat file which defines the bits for each of the flags, including the extra ones.
USA #4
This may be a stupid question, but for what it's worth here goes.

Have you checked to make sure you've defined the exit as 'isdoor' on both ends? What I mean is, if you have two rooms, say you're going west from room 1 into room 2, then you have two exits. The one in room 1 that goes west to room 2 and the one in room 2 that goes east (back) to room 1.

If that's the case, you need to set up the exit(s) in both rooms (1 and 2) to have an 'isdoor' flag. That is, the west exit in room 1 must be a door and the east exit in room 2 must be a door. Not sure how it would happen in-game if you didn't do this, but I know that's how I've always done it (with AreaEditor, no less) and I've never had a single problem with doors or locks/keys functioning properly.

Just something else to consider. Hope it helps. :)