Manual:DIL Manual/npccount
Jump to navigation
Jump to search
Contents
npccount
Field (integer, read-only; on a zoneptr).
z.npccount : integer
Meant to be the number of NPCs the zone defines, but the server never counts them: it is always 0. To count the copies of one NPC in the game, use loadcount.
Notes
- It can't be assigned (vmc: "Illegal lvalue").
- On a null zoneptr it fails.
- roomcount does count the zone's rooms.
Example
dilbegin string zone_npcs(z : zoneptr);
code
{
if (z == null)
return ("");
return (z.name + ": " + itoa(z.npccount) + " NPCs.");
}
dilend
Tells how many NPCs a zone has; it shows 0 until the server counts them.