Manual:DIL Manual/title
Jump to navigation
Jump to search
Contents
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:
$1nin act() shows the title of anything but a player ("a long sword","the cityguard"). For a room it is the heading shown onlook. 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
titlein the zone's%zoneheader.
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.
titleis 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.