WorldMap
constWorldMap:object
Defined in: client/api.d.ts:2057
The map screen at this machine, and the player’s own marker on it. Nothing here is replicated: a marker everyone should see is one the server tells every client to make.
Type Declaration
Section titled “Type Declaration”isOpen
Section titled “isOpen”
readonlyisOpen:boolean
Whether the map screen is up right now. False in the main menu and across a level load, when there is no map page at all.
clearWaypoint()
Section titled “clearWaypoint()”clearWaypoint():
boolean
Takes the player’s marker off the map they are looking at. It runs the game’s own removal, so mapWaypointCleared is raised as it would be for the player.
Returns
Section titled “Returns”boolean
True when there was a marker to take off.
discover()
Section titled “discover()”discover(
id):boolean
Marks a place on this player’s map as discovered, silently: no toast, no XP, no discovery trigger. What a resource that keeps a character’s discoveries calls after the character is loaded, since every session starts on a fresh map. A point of interest raises poiDiscovered as it is marked; a location raises nothing.
Parameters
Section titled “Parameters”A point of interest or a location – a town, a district – as poiDiscovered or locationDiscovered handed it out. data4 must be a Uint8Array of eight bytes.
Returns
Section titled “Returns”boolean
True when the id named a place in the loaded level; false otherwise, or before the level is up.
getWaypoint()
Section titled “getWaypoint()”getWaypoint():
MapWaypoint|null
Reads the marker the player has dropped on the map they are looking at. The game keeps at most one per map.
Returns
Section titled “Returns”MapWaypoint | null
The marker’s position and the map it belongs to, or null when there is none.
isCategoryVisible()
Section titled “isCategoryVisible()”isCategoryVisible(
type):boolean
Whether marks of this type are currently drawn on the compass and listed in the map legend.
Parameters
Section titled “Parameters”string
One of the game’s own compass mark types, spelled the way the game spells it – Shop, QuestGiver, GeneralPoi. The full list is the type a Blip accepts.
Returns
Section titled “Returns”boolean
True when they are shown.
moveWaypoint()
Section titled “moveWaypoint()”moveWaypoint(
position):boolean
Moves the marker the player has already dropped. It cannot create one, so it reads false when there is nothing down.
Parameters
Section titled “Parameters”position
Section titled “position”Where to put it, in world-space metres. Nothing snaps it to the terrain.
Returns
Section titled “Returns”boolean
True when there was a marker to move.
revealAllFog()
Section titled “revealAllFog()”revealAllFog():
boolean
Clears the fog of war over the whole level, as the game’s own player_revealFow does, and leaves discovery alone: places still become discovered when the player finds them. The fog is also what hides the names of places not yet found, so from then on the map writes a town’s name only once the player knows of it. What a server that keeps reveal_map off for the discoveries, but wants no fog, calls once the character is loaded. A level load brings the fog back.
Returns
Section titled “Returns”boolean
True when the level’s fog took it; false before the level is up.
revealFog()
Section titled “revealFog()”revealFog(
position):boolean
Clears the fog of war around a point by the game’s own reveal radius, as walking there does. What a resource that keeps where a character has been calls after the character is loaded. Only matters while the server’s reveal_map is off; otherwise there is no fog.
Parameters
Section titled “Parameters”position
Section titled “position”A world-space point; only x and y count.
Returns
Section titled “Returns”boolean
True when the level’s fog took it; false before the level is up.
setCategoryVisible()
Section titled “setCategoryVisible()”setCategoryVisible(
type,visible):boolean
Shows or hides a whole category of the game’s own map markers – every shop, every quest giver – through the switch the map legend’s rows drive. It affects the marks already placed as well as later ones. DLC icons share a legend row with the entry they belong to, so setting one sets the group.
Parameters
Section titled “Parameters”string
One of the game’s own compass mark types, spelled the way the game spells it – Shop, QuestGiver, GeneralPoi. The full list is the type a Blip accepts.
visible
Section titled “visible”boolean
Whether marks of that type should be drawn.
Returns
Section titled “Returns”boolean
True when the map page was there to take it.