Manual:DIL Manual/title

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:10, 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

title

Field (string; units: all, read/write; also on zoneptr, read-only in practice).

u.title : string
z.title : string
  • unitptr: the unit's title. For an object or an NPC it is the short name the game's messages use: $1n in act() shows the title of anything but a player ("a long sword", "the cityguard"). For a room it is the heading shown on look. For a player it is the text shown after the name; the guild masters in guilds.zon set it to "the", the race and the guild rank. Messages use a player's name instead.
  • zoneptr: the zone's title, from title in the zone's %zone header.

Notes

  • On a unit, assigning a string replaces the title; assigning null or "" empties it.
  • A zone's title can't be changed. vmc accepts z.title := ..., but at run time the program logs "DIL SERIOUS: ... Type error in ordinary string assignment <- hash" and stops, and the title stays as it was.
  • When renaming an object or NPC, change outside_descr and names to match.
  • On null it fails.
  • title is a reserved word: it can't be a variable name.

Example

dilbegin where_am_i();
var
   room : unitptr;
   z : zoneptr;
code
{
   room := self.outside;
   z := findzone(room.zoneidx);
   sendtext("You are in " + room.title + ", in " + z.title + ".<br/>", self);
   quit;
}
dilend

Tells a player the titles of the room and the zone they are in.

See also