The
Fetch Command
Syntax:
F
Stack Usage:
( depth location positionMask typeMask .
. . objectID )
Purpose:
To find the object residing in a heap of objects at a
given location.
- depth Parameter - means the depth of the object in the 'virtual'
pile of objects. The 'virtual' pile consists only of thos objects
that meet the 'positionMask' and 'typeMask' criteria. All other
objects are ignored. The object at the top of this 'virtual' pile
is at depth zero.
- location Parameter - the absolute location of the
cell to be examined. This includes the offsets for the level.
- positionMask Parameter - There are four positions in each cell
where objects might be placed. North, East, South, and West for a
wall cell. Northwest, Northeast, Southeast, and Southwest for
items in an open cell. These directions are respectively numbered
0, 1, 2, and 3. The position mask should have a bit set for each
position to be considered when building the 'virtual' pile of
objects. Bit zero for position zero and so on. If the
positionMask is set to the value negative-one ( -1 ) then only the one
position as described by the location parameter will be considered.
- typeMask Parameter - There are several kinds of objects -
weapons, potions, chest, etc. See
objectTypes The typeMask should have a bit set for each
type of object to be considered when building the 'virtual' pile of
objects. For example, bit 5 ( 32 ) for weapons
objects.
- objectID Result - This is the unique object ID for the object
found in the 'virtual' pile of objects. If no object exists at
the specified depth then the resulting objectID will be 0xffff ( 65535
).