Manual:DIL Manual/objs

From DikuMUD Wiki
Jump to navigation Jump to search

objs

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

z.objs : unitptr

A copy, in the game, of the zone's object whose symbolic name sorts first. Only that one object is looked at: if no copy of it is loaded, the field fails, even when copies of the zone's other objects exist.

It is not the start of a list of the zone's objects: next on the object gives the next unit in the same place. To find copies of a particular object, use findsymbolic("name@zone").

Notes

  • It fails on a null zoneptr, on a zone without objects, and when the first object has no copy in the game. A failed value isn't assigned: after u := z.objs; in those cases, u still holds what it held before, so set it to null first.
  • It can't be assigned (vmc: "Illegal lvalue").
  • No zone in the game uses it.

Example

dilbegin log_first_obj(z : zoneptr);
var
   u : unitptr;
code
{
   if (z == null)
      return;
   u := null;
   u := z.objs;
   if (u != null)
      log(z.name + ": " + u.symname);
}
dilend

Logs the copy of a zone's first object, if one is loaded.

See also