WorldEntity

Methods
10
Fields
3

Getting one

client:getTopLevelWorldView():worldEntities():byIndex(…)

Methods

MethodReturnsDescription
getWorldView()WorldViewThe world view it carries (its id is the entity's).
interact(number)booleanOp op (1 to 5) of this world entity (a boat). By op number, since a world entity's op texts are not read. Raises for an op outside 1 to 5.
getLocalLocation()LocalPoint?Where it is in the world view it sails in: its fine position now (128 to a tile; world view 0), nil once it is gone. Raises on a client w…
getOrientation()numberWhich way it faces (0..2047, the client's angle units). Raises once it is gone, and on a client whose table does not place its fields.
getOwnerType()numberWho owns it: OWNER_TYPE_NOT_PLAYER, OWNER_TYPE_OTHER_PLAYER or OWNER_TYPE_SELF_PLAYER (the local player's own boat), as the server se…
isHiddenForOverlap()booleanWhether the client draws it hidden because it overlaps another (faded out, as the client fades a boat that overlaps the local player's). Ra…
getConfig()WorldEntityConfig?Its config (the kind of boat it is), nil while it has none or once it is gone. Raises on a client whose table does not place its fields.
getCameraFocus()LocalPoint?Where the camera orbits while it follows the boat (client:getCameraFocusEntity() is the boat then): its getLocalLocation(). nil once…
transformToMainWorld(LocalPoint)LocalPoint?Where point, a local point in this entity's own world view, is in the world view it sails in, as the entity stands and turns now (world v…
equals(any)booleanWhether other equals this WorldEntity, as == answers it (false for a value of another class).

Fields

FieldTypeDescription
OWNER_TYPE_NOT_PLAYERnumberNot owned by a player.
OWNER_TYPE_OTHER_PLAYERnumberOwned by another player.
OWNER_TYPE_SELF_PLAYERnumberOwned by the local player.

Returned by

MethodReturnsDescription
WorldEntityDespawned.getWorldEntityWorldEntityThe world entity.
WorldEntitySet.byIndexWorldEntity?The world entity with id index, or nil.
WorldEntitySpawned.getWorldEntityWorldEntityThe world entity.

Method details

interact

interact: (WorldEntity, number) -> boolean

Op op (1 to 5) of this world entity (a boat). By op number, since a world entity's op texts are not read. Raises for an op outside 1 to 5.

getLocalLocation

getLocalLocation: (WorldEntity) -> LocalPoint?

Where it is in the world view it sails in: its fine position now (128 to a tile; world view 0), nil once it is gone. Raises on a client whose table does not place the world entity's fields.

getOrientation

getOrientation: (WorldEntity) -> number

Which way it faces (0..2047, the client's angle units). Raises once it is gone, and on a client whose table does not place its fields.

getOwnerType

getOwnerType: (WorldEntity) -> number

Who owns it: OWNER_TYPE_NOT_PLAYER, OWNER_TYPE_OTHER_PLAYER or OWNER_TYPE_SELF_PLAYER (the local player's own boat), as the server sent it. Raises once it is gone, and on a client whose table does not place its fields.

isHiddenForOverlap

isHiddenForOverlap: (WorldEntity) -> boolean

Whether the client draws it hidden because it overlaps another (faded out, as the client fades a boat that overlaps the local player's). Raises once it is gone, and on a client whose table does not place its fields.

getConfig

getConfig: (WorldEntity) -> WorldEntityConfig?

Its config (the kind of boat it is), nil while it has none or once it is gone. Raises on a client whose table does not place its fields.

getCameraFocus

getCameraFocus: (WorldEntity) -> LocalPoint?

Where the camera orbits while it follows the boat (client:getCameraFocusEntity() is the boat then): its getLocalLocation(). nil once it is gone; raises as getLocalLocation() does.

transformToMainWorld

transformToMainWorld: (WorldEntity, LocalPoint) -> LocalPoint?

Where point, a local point in this entity's own world view, is in the world view it sails in, as the entity stands and turns now (world view 0). What a plugin measures from or tests against the main world goes through this first; for a point in any world view, WorldPoint.fromLocalMainWorld also finds the entity and undoes instancing. nil once the entity is gone. Raises when point is in another world view, and on a client whose table does not place its fields.

equals

equals: (WorldEntity, any) -> boolean

Whether other equals this WorldEntity, as == answers it (false for a value of another class).