named
named: (ObjectQuery, string) -> ObjectQueryKeep only those whose whole name matches, ignoring case and markup: | separates alternatives and * is any run of characters.
names- The name pattern.
scene:objects()| Method | Returns | Description |
|---|---|---|
named(string) | ObjectQuery | Keep only those whose whole name matches, ignoring case and markup: | separates alternatives and * is any run of characters. |
containing(string) | ObjectQuery | Keep only those whose name contains the text, ignoring case and markup: | separates alternatives. |
ids({ number }) | ObjectQuery | Keep only these ids. |
hasAction(string | { string }) | ObjectQuery | Keep only those whose definition offers one of actions: an option or a list of them, each matched whole, in any case and with markup igno… |
within(number) | ObjectQuery | Keep only those within a radius of the local player. |
withinArea(WorldArea) | ObjectQuery | Keep only those inside an area. |
interactable() | ObjectQuery | Keep only those the local player can act on right now. |
interactableWithin(number, boolean) | ObjectQuery | Keep only those actable from within a range. |
count() | number | How many survived the narrowing. Consumes the query. |
nearest() | TileObject? | The nearest survivor. Consumes the query. |
collect() | { TileObject } | Every survivor, nearest first. Consumes the query. |
| Method | Returns | Description |
|---|---|---|
SceneDomain.objects | ObjectQuery | A query over every scene object: walls, decorations, doors, resources. Every loc in the LOADED SCENE, not a window around the player. Narro… |
namednamed: (ObjectQuery, string) -> ObjectQueryKeep only those whose whole name matches, ignoring case and markup: | separates alternatives and * is any run of characters.
namescontainingcontaining: (ObjectQuery, string) -> ObjectQueryKeep only those whose name contains the text, ignoring case and markup: | separates alternatives.
textidsids: (ObjectQuery, { number }) -> ObjectQueryKeep only these ids.
idshasActionhasAction: (ObjectQuery, string | { string }) -> ObjectQueryKeep only those whose definition offers one of actions: an option or a list of them, each matched whole, in any case and with markup ignored ("open" keeps an Open door, not an Open-gate one).
scene:objects():named(name):hasAction(action):nearest(), then interact(action) on it when it is not nil, clicks the nearest object of that name whose definition offers action, found in one host crossing. named splits | alternatives, and objects at the same distance keep the scan order.
ids(ids):hasAction(actions):nearest() (named(table.concat(names, "|")) for names), then interact with the first of actions its definition offers (client:getObjectDefinition(o:getId()):getActions()), clicks the nearest object of any listed id offering any listed action.
actionswithinwithin: (ObjectQuery, number) -> ObjectQueryKeep only those within a radius of the local player.
radiuswithinAreawithinArea: (ObjectQuery, WorldArea) -> ObjectQueryKeep only those inside an area.
areainteractableinteractable: (ObjectQuery) -> ObjectQueryKeep only those the local player can act on right now.
interactableWithininteractableWithin: (ObjectQuery, number, boolean) -> ObjectQueryKeep only those actable from within a range.
rangerequireLineOfSightcountcount: (ObjectQuery) -> numberHow many survived the narrowing. Consumes the query.
nearestnearest: (ObjectQuery) -> TileObject?The nearest survivor. Consumes the query.
nil when none survived.collectcollect: (ObjectQuery) -> { TileObject }Every survivor, nearest first. Consumes the query.