WorldView

Methods
22
Fields
1

Getting one

client:getTopLevelWorldView()
client:getWorldView(…)
client:getCameraFocusWorldView()

Methods

MethodReturnsDescription
getId()numberIts id.
isTopLevel()booleanWhether it is the top level.
getScene()SceneIts scene.
getPlane()numberThe local player's plane in it.
getSelectedSceneTile()Tile?The tile under the mouse, on this world view's plane (getPlane()), or nil when the mouse is over none of its tiles. The client finds it…
getSizeX()numberIts width in tiles.
getSizeY()numberIts length in tiles.
getBaseX()numberThe world x of its scene tile (0, 0).
getBaseY()numberThe world y of its scene tile (0, 0).
getTileHeights(){{{number}}}The tile corner heights, [plane][x][y] (1-based in Luau), a side one longer than the scene. A copy: writing it changes nothing.
getTileSettings(){{{number}}}The tile settings, [plane][x][y] (bit 1 blocked floor, bit 2 bridge, bit 4 under roof, ...). A copy: writing it changes nothing.
getCollisionMaps(){ n: number, [number]: CollisionData? }One collision map per plane, nil where a plane has none.
npcs()NpcSetThe NPCs in it: a set walked with for _, npc in set, looked up with byIndex, counted with #.
players()PlayerSetThe players in it, as npcs().
worldEntities()WorldEntitySetThe world entities (boats) in it, by id, as npcs().
worldViews()WorldViewSetThe world views of the world entities in it, as npcs().
getGraphicsObjects(){GraphicsObject}The spot animations playing in it, in the client's order.
isInstance()booleanWhether it is an instance (the top level's flag; a world entity's world view answers false).
getInstanceTemplateChunks(){{{number}}}The instance template chunks, [plane][chunkX][chunkY], packed as plane << 24 | x << 14 | y << 3 | rotation << 1, -1 where there is none.
getMapRegions(){number}The map regions it covers, ascending.
contains(WorldPoint)boolean(WorldView, WorldPoint) -> boolean: Whether the world tile's x and y are in it (the plane is not tested).
contains(LocalPoint)boolean
equals(any)booleanWhether other equals this WorldView, as == answers it (false for a value of another class).

Fields

FieldTypeDescription
TOPLEVELnumberThe top-level world view's id.

Returned by

MethodReturnsDescription
Actor.getWorldViewWorldViewThe world view the actor is in: the top level, or a world entity's (a boat's).
CameraFocusableEntity.getWorldViewWorldViewThe top level, whichever world view holds the tile.
Client.getCameraFocusWorldViewWorldView?The world view of the entity the camera follows (client:getCameraFocusEntity():getWorldView()), without the entity. A player or an NPC an…
Client.getTopLevelWorldViewWorldViewThe top-level world view (the scene the local player is in; boats have their own).
Client.getWorldViewWorldView?World view id, or nil when the client has none with that id.
GraphicsObject.getWorldViewWorldViewThe world view it plays in.
ItemLayer.getWorldViewWorldViewThe world view it is in.
PreMapLoad.getWorldViewWorldViewThe world view the scene is loading for (the top level).
TileObject.getWorldViewWorldViewThe world view the object is in.
WorldEntity.getWorldViewWorldViewThe world view it carries (its id is the entity's).
WorldViewLoaded.getWorldViewWorldViewThe world view.
WorldViewSet.byIndexWorldView?The world view with id index, or nil.
WorldViewUnloaded.getWorldViewWorldViewThe world view.

Method details

getSelectedSceneTile

getSelectedSceneTile: (WorldView) -> Tile?

The tile under the mouse, on this world view's plane (getPlane()), or nil when the mouse is over none of its tiles. The client finds it as it draws the scene, so an overlay reads this frame's. While the menu is open, the tile the menu was opened over (the column its "Walk here" entry was built from), a snapshot taken when the menu opens; nil if the open menu has no "Walk here" of this world view. Raises on a client whose table does not place the client's field, rather than answer nil.

getTileHeights

getTileHeights: (WorldView) -> {{{number}}}

The tile corner heights, [plane][x][y] (1-based in Luau), a side one longer than the scene. A copy: writing it changes nothing.

getTileSettings

getTileSettings: (WorldView) -> {{{number}}}

The tile settings, [plane][x][y] (bit 1 blocked floor, bit 2 bridge, bit 4 under roof, ...). A copy: writing it changes nothing.

npcs

npcs: (WorldView) -> NpcSet

The NPCs in it: a set walked with for _, npc in set, looked up with byIndex, counted with #.

isInstance

isInstance: (WorldView) -> boolean

Whether it is an instance (the top level's flag; a world entity's world view answers false).

getInstanceTemplateChunks

getInstanceTemplateChunks: (WorldView) -> {{{number}}}

The instance template chunks, [plane][chunkX][chunkY], packed as plane << 24 | x << 14 | y << 3 | rotation << 1, -1 where there is none.

contains

contains: ((WorldView, WorldPoint) -> boolean) & ((WorldView, LocalPoint) -> boolean)

(WorldView, WorldPoint) -> boolean: Whether the world tile's x and y are in it (the plane is not tested).

(WorldView, LocalPoint) -> boolean: Whether the local point is in it.

equals

equals: (WorldView, any) -> boolean

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