Manual:DIL Manual/symname

From DikuMUD Wiki
Jump to navigation Jump to search

symname

Field (string, read-only; units: all).

u.symname : string

The unit's symbolic name, "nameidx@zoneidx": "corpse@death", or "papi@_players" for a player. It is the form load() and findsymbolic() take.

Notes

  • It is a field, not a function: u.symname.
  • A unit with no definition gives "NO-NAME@NO-ZONE".
  • It can't be assigned (vmc: "Illegal lvalue").
  • On null it fails.
  • Many units share a symname. With idx, findsymbolic(u.symname, u.idx) finds this one unit again later.

Example

dilbegin check_corpse(corpse : unitptr);
code
{
   if (corpse.symname != "corpse@death")
   {
      log("Not a corpse: " + corpse.symname);
      return;
   }
   act("$2n lies here.", A_ALWAYS, self, corpse, null, TO_CHAR);
}
dilend

Checks that a unit is a corpse and logs what it got instead, as in death.zon.

See also