Manual:DIL Manual/flags

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:11, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

flags

Field (integer, read/write; units: all).

u.flags : integer

The unit flags, a bit set of UNIT_FL_* values from vme.h, shared by all kinds of unit. In a zone file they are flags {UNIT_FL_...}. Test them with isset(), change them with set() and unset().

Flag Meaning
UNIT_FL_PRIVATE A private room, meant for at most two characters.
UNIT_FL_INVISIBLE Invisible: seen only with detect invisible, or by creators and up.
UNIT_FL_NO_BURY Meant to stop burying things in it (a boat, a house).
UNIT_FL_BURIED Buried in what it is in: nobody sees it, except from inside.
UNIT_FL_NO_SUM No summoning into this room or object; on a character, it can't be summoned.
UNIT_FL_NO_SUM_FROM No summoning out of this room; on a character, it can't be summoned from anywhere.
UNIT_FL_NO_TEL No teleporting out of this room or object; on a character, it blocks teleport.
UNIT_FL_NO_TEL_TO No teleporting to it.
UNIT_FL_SACRED Characters in it (or in a unit inside it) regain hit points, mana and endurance twice as fast.
UNIT_FL_NO_MOB NPCs are not to enter it; the walking scripts in the zones check it.
UNIT_FL_NO_WEATHER No weather messages reach those inside.
UNIT_FL_INDOORS Indoors: no daylight counts towards its light (see light).
UNIT_FL_TRANS Transparent (a horse, a boat): those inside see and talk to those outside, and light shines through, unless it is closed.
UNIT_FL_NOSAVE Not saved with a player's inventory; a player in such a room doesn't come back into it on logging in.
UNIT_FL_MAGIC Shows an aura of magic when examined.

UNIT_FL_NO_TELEPORT is the four teleport and summon flags together. The descriptions follow the comments in vme.h.

Notes

  • A 16-bit number: only the flags above fit.
  • Flags of one kind of unit are elsewhere: objectflags, roomflags, charflags, npcflags, pcflags. What can be done with an object is manipulate; open and locked is openflags.
  • Setting or clearing UNIT_FL_TRANS from DIL doesn't recount the light around the unit (illum); the wizard set command does.
  • On null it fails.

Example

dilbegin bury_item(item : unitptr);
code
{
   if ((item.type != UNIT_ST_OBJ) or (not isset(item.manipulate, MANIPULATE_TAKE))
       or isset(self.outside.flags, UNIT_FL_NO_BURY))
   {
      act("You can't bury $2n.", A_ALWAYS, self, item, null, TO_CHAR);
      return;
   }
   link(item, self.outside);
   set(item.flags, UNIT_FL_BURIED);
   act("You bury $2n.", A_ALWAYS, self, item, null, TO_CHAR);
   return;
}
dilend

Buries an object in the room, as the bury command in commands.zon does (which doesn't check UNIT_FL_NO_BURY).

See also