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
<vnum>— the prototype vnum to load. If no prototype has that vnum, the load fails (and so does not suppress the default action).[target]— where to put the object: a creature (carried), an object (placed inside it), or a room (dropped there). Defaults to the owner.[max]— the maximum number of this object allowed in the world; the load is refused if that many already exist. Defaults to the system limit; pass-1to disable the check.
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
mload— load a mobile.opurge— remove objects the owner holds.object— look up an object prototype without loading it.trans— move an existing object to a room.- Handlers, events, and phases