prev | toc | next
 

Flags:

Flags — also called `bits' — provide an economical way to store important information about all objects in the database.

Usually you can see both the dbref and flags of any objects you control when they appear in a Contents or Inventory list, or in the case of rooms, simply by doing a look. Whether or not you can see this information is determined by the S flag set on your character: type @set me =!S to see dbrefs and flags, or @set me = S to hide them (in this context, the S flag means `Silent'). Whether you are set Silent or not, you can see the flags set on an object you control by examining it.

The first flag listed after an object's dbref is its `type flag'. The type flag functions differently than any remaining flags. It determines the type of the object; it is set at the time of the object's creation; it cannot be changed; and it determines the meaning or function of remaining flags. If an object is created with the @dig command, it will be a room and will have an R flag in the first position. If it is created with the @action or @open command, it will be an exit and will have an E flag. If it's created with the @program command, it will be a program and will have an F flag. If it's created with the @pcreate command, it will be a player and have a P flag. If it's created with the @create command, it will be a thing, and will have none of these flags. All flags are either `set' or `not set' at all times.

The meaning or function of the remaining flags depends on their context... that is, on what type flag the object has. For example, if a program (something with an F flag in the first position) is set D, the D flag means `Debug', and debugging information is shown whenever the program runs. If a room (something with an R flag in the first position) is set D, the D flag means `Dark': the `Contents' list won't appear for a player who doesn't control the room, and no notices are emitted when players connect and disconnect in the room. In short, the same flag won't always mean the same thing. While the context-dependent meanings of flags can be confusing for new users, it provides an elegantly economical way to store important information. The meanings of each flag in relation to the type flags are listed in Section 2.5.

The type flag is set at the time of an object's creation. The remaining flags can be toggled with the @set command and the `not operator' (an ! exclamation point). The syntax for setting a flag is @set <object> = <flag>. For removing a flag, it's @set <object> = !<flag>. Flags are not case sensitive: @set here = D and @set here = d produce the same result.

====================================
> @set here = D
  Flag set.
> @set here = !D
  Flag reset.
====================================

Mortals' use of flags is restricted in a few ways. Most importantly, they can only set flags on things they control. Players cannot change the state of the Zombie (Z) or Dark (D) flags on themselves. They cannot set themselves or anything they own Builder (B) or Wizard (W). They must have a Mucker bit (flags M1, M2, or M3) in order to change the Mucker bit of a program. Players can set the Mucker bit of a program they own to a level lower than or equal to their own, but not higher. Wizard's control all objects and may change the state of any flag on any object, with two exceptions: (1) type flags can never be changed; (2) if the MUCK is compiled with the god_priv option (which it usually is), wizards cannot set players W or !W.

prev | toc | top | next