Manual:DIL Manual/objcount

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

objcount

Field (integer, read-only; on a zoneptr).

z.objcount : integer

Meant to be the number of objects the zone defines, but the server never counts them: it is always 0. To count the copies of one object 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_sizes(z : zoneptr);
code
{
   if (z == null)
      return ("");
   return (z.name + ": " + itoa(z.roomcount) + " rooms, " + itoa(z.objcount) + " objects.");
}
dilend

Tells the size of a zone; the object count shows 0 until the server counts objects.

See also