[Home] [Downloads] [Search] [Help/forum]

Locks


Introduction

Locks are a very important part of MUSH building - they help give the world its "flavour", by enforcing rules and conditions.

Basically you could define a lock thus:

This is a rather broad definition. There are various types of lock (use, mail, enter, teleport) and so on, so the word "use" in the definition above has a fairly general meaning.

Examples of locks


Success and failure messages

You should generally set a "success" and "failure" message on any object which is locked, so that the player attempting to pass the lock sees an explanatory message. For example:


@lock east = +key
@succ east = You unlock the door and go through it.
@fail east = You must be carrying the key to go through this door.

You should also set "other success" and "other failure" messages on a locked object, so that others in the same room see what is happening to the player.


@osucc east = unlocks the door and passes through.
@ofail east = tugs uselessly at the door.

These messages are covered in more detail in a subsequent page.

Click on Lock Messages for more details about messages that are triggered by attempting to use locked objects.


@LOCK syntax


  @lock[/<switch>] <object>=<key>
Locks <object> to a specific key(s). <object> can be specified as <name> or #<number>, or as 'me' or 'here'. Boolean expressions are allowed, using '&' (and), '|' (or), '!' (not), and parentheses ('(' and ')') for grouping. To lock to a player, prefix their name with '*' (ex. '*Moonchilde').

Example:

@lock Purse = me|*Darling

will lock object purse so that only you or player Darling can take it.


There are further topics on locks:
[Previous] [Next] [Back] [Home]
Written by Nick Gammon - 5K

Comments to Gammon Software support

[Best viewed with any browser - 2K]    Internet Contents Rating Association (ICRA) - 2K    [Web site powered by FutureQuest.Net]

Page updated on Wednesday, 15 December 2004