getId
getId: (TileItem) -> numberThe item id.
scene:groundItems():nearest()
scene:tileAt(…):getItemLayer():getTop()
scene:tileAt(…):getItemLayer():getMiddle()| Method | Returns | Description |
|---|---|---|
getId() | number | The item id. |
getQuantity() | number | How many. |
getVisibleTime() | number | The tick it becomes visible to other players at, on the client:getTickCount() clock. |
getDespawnTime() | number | The tick it despawns at, on the client:getTickCount() clock. |
getOwnership() | number | Who owns it: OWNERSHIP_NONE, _SELF, _OTHER or _GROUP. |
isPrivate() | boolean | Whether only its owner can see it. |
getTile() | Tile | The tile it lies on. The handle is keyed by it, so an item from scene:groundItems() can say where it is. |
isPresent() | boolean | Whether the item is still on the floor: Bento's, for code that keeps handles (a picked-up item's handle answers its last values). |
interact(string) | boolean | Act on the item through the virtual mouse: option is one of its ground actions ("Take"; "" for "Take"). The scheduler resolves THIS sta… |
target() | boolean | Use what this plugin selected on this stack (its id and its tile). Once per selection, and only after one of this plugin's that admits a gr… |
| Field | Type | Description |
|---|---|---|
OWNERSHIP_NONE | number | No one owns it. |
OWNERSHIP_SELF | number | The local player owns it. |
OWNERSHIP_OTHER | number | Another player owns it. |
OWNERSHIP_GROUP | number | The local player's group owns it. |
| Method | Returns | Description |
|---|---|---|
GroundItemQuery.collect | { TileItem } | Every survivor, nearest first. Consumes the query. |
GroundItemQuery.nearest | TileItem? | The nearest survivor. Consumes the query. |
ItemDespawned.getItem | TileItem | The item. |
ItemLayer.getBottom | TileItem? | The third item drawn, if any. |
ItemLayer.getMiddle | TileItem? | The second item drawn, if any (the next most valuable of another id). |
ItemLayer.getTop | TileItem? | The most valuable item, drawn first (walk the rest with Tile:getGroundItems()). |
ItemQuantityChanged.getItem | TileItem | The item. |
ItemSpawned.getItem | TileItem | The item. |
Tile.getGroundItems | {TileItem}? | Its floor items, nil when there are none: the most valuable (the item layer's top) first; the rest in the client's value order, least val… |
getIdgetId: (TileItem) -> numberThe item id.
getQuantitygetQuantity: (TileItem) -> numberHow many.
getVisibleTimegetVisibleTime: (TileItem) -> numberThe tick it becomes visible to other players at, on the client:getTickCount() clock.
getDespawnTimegetDespawnTime: (TileItem) -> numberThe tick it despawns at, on the client:getTickCount() clock.
getOwnershipgetOwnership: (TileItem) -> numberWho owns it: OWNERSHIP_NONE, _SELF, _OTHER or _GROUP.
isPrivateisPrivate: (TileItem) -> booleanWhether only its owner can see it.
getTilegetTile: (TileItem) -> TileThe tile it lies on. The handle is keyed by it, so an item from scene:groundItems() can say where it is.
isPresentisPresent: (TileItem) -> booleanWhether the item is still on the floor: Bento's, for code that keeps handles (a picked-up item's handle answers its last values).
interactinteract: (TileItem, string) -> booleanAct on the item through the virtual mouse: option is one of its ground actions ("Take"; "" for "Take"). The scheduler resolves THIS stack (its id and its tile in its world view, the GROUND_ITEM_*_OPTION entry), moves the virtual mouse and clicks; a nearer item with a similar name is never taken instead, and nothing is clicked when the stack is gone by then. false when the item is gone or outside the views Bento acts on (on another player's boat), or it has no definition.
targettarget: (TileItem) -> booleanUse what this plugin selected on this stack (its id and its tile). Once per selection, and only after one of this plugin's that admits a ground item (Telekinetic Grab, an item's "Use"); nothing is clicked when the stack is gone by the time the click fires. inventory:useOnGroundItem and magic:castOnGroundItem are the select and the use in one call. false when it has no such selection, or the item is gone or outside the top level and the boat the player stands in.