oload

oload <vnum> [target] [max]

Load a new object from its prototype.

A fresh copy of the object with the given vnum is created and placed. With no target, the object goes to the owner — into a mob's inventory, into an object owner, or into a room owner's contents. The optional max limits how many of that object may exist before the load is refused.

Arguments

Returns

null. Like the other action commands, a successful oload in the handle phase suppresses the event's default action. A failed load (unknown vnum, or the max limit reached) does not suppress it.

Examples

after command (say) {
  oload 1
  do "say I now hold [count [inventory $self]] item(s)."
}

Object vnum 1 is loaded into the mob's own inventory; the follow-up say reports a count of 1, confirming the object arrived.

handle command (open) {
  oload 1 [room $self]
}

The object is loaded into the owner's current room instead of its inventory (see room).

See also