PlayerQuery

Group
Queries
Methods
12
Fields
None

Getting one

scene:players()

Methods

MethodReturnsDescription
named(string)PlayerQueryKeep only those whose whole name matches, ignoring case and markup: | separates alternatives and * is any run of characters.
containing(string)PlayerQueryKeep only those whose name contains the text, ignoring case and markup: | separates alternatives.
within(number)PlayerQueryKeep only those within a radius of the local player.
withinArea(WorldArea)PlayerQueryKeep only those inside an area.
withinPath(number)PlayerQueryKeep only those a walk of at most steps reaches from the local player.
reachable()PlayerQueryKeep only those the local player can walk to.
interactable()PlayerQueryKeep only those the local player can act on right now.
interactableWithin(number, boolean)PlayerQueryKeep only those actable from within a range.
hasLineOfSight()PlayerQueryKeep only those with a clear line of sight to the local player.
count()numberHow many survived the narrowing. Consumes the query.
nearest()Player?The nearest survivor. Consumes the query.
collect(){ Player }Every survivor, nearest first. Consumes the query.

Returned by

MethodReturnsDescription
SceneDomain.playersPlayerQueryA query over every other player in the scene, whose terminals hand out Player handles.

Method details

named

named: (PlayerQuery, string) -> PlayerQuery

Keep only those whose whole name matches, ignoring case and markup: | separates alternatives and * is any run of characters.

names
The name pattern.

containing

containing: (PlayerQuery, string) -> PlayerQuery

Keep only those whose name contains the text, ignoring case and markup: | separates alternatives.

text
The text to look for.

interactableWithin

interactableWithin: (PlayerQuery, number, boolean) -> PlayerQuery

Keep only those actable from within a range.

range
How far away to allow, in tiles.
requireLineOfSight
Whether the line of sight must be clear.

count

count: (PlayerQuery) -> number

How many survived the narrowing. Consumes the query.