home » builders » builder's lessons » door resets

Door resets

When you create an exit in the #ROOMS section you can set a door to be closed and locked or whatever state you wish. Characters can come along and open and close and lock doors as they wish, and unless a reset is defined the door will be left as the character left the door. If you want your door to shut you can either write a program on a mobile to shut and or lock it (a more IC approach), or you can use resets to set the door state to what you want it to be. This will reset the door state each copyover reguardless of what characters have done with the door.

Door states

This will determine if a door is locked and other states whenever an area resets. The syntax is as follows:

D 0 room-vnum door state ; comment

The following is a sample of a door that is to be locked each area repop.

D 0 QQ00 1 3 ; Door to the east is locked

D - This tells the game that this is going to be a door reset.

0 - This is not used by the game but is needed in order for the area to load.

QQ00 - This is the vnum of the room with the door.

1 - This is the direction of the door.

3 - This is the state of the door using the bit vector.

; Door to the east is locked - This is the comment.

The QQ00 is the vnum of a room. The next number is a door number from 0 to 6, door direction numbers. See the table below for door direction numbers. The final number indicates how to set the door by default. Door states are: 0 open unlocked, 1 closed unlocked, 3 closed locked.

Room exits must be coherent: if room 1 has an exit to room 2, and room 2 has an exit in the reverse direction, that exit must go back to room 1. This doesn't prevent one-way exits; room 2 doesn't HAVE to have an exit in the reverse direction.

Random rooms

Resets can be used to make a maze, that will change constantly.

R 0 room-vnum last-door ; comment

R 0 QQ08 4 ; two dimensional maze in room 8

For the 'R' command, the room-vnum is the vnum of a room. The last-door is a door number. When this command, the doors from 0 to the indicated door number are shuffled. The room will still have the same exits leading to the same other rooms as before, but the directions will be different. Thus, a door number of 4 makes a two-dimensional maze room; a door number of 6 makes a three-dimensional maze room.