Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectClient APIGenerated

WorldMap

const WorldMap: 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.

readonly isOpen: 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(): 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.

boolean

True when there was a marker to take off.

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.

LocationId

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.

boolean

True when the id named a place in the loaded level; false otherwise, or before the level is up.

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.

MapWaypoint | null

The marker’s position and the map it belongs to, or null when there is none.

isCategoryVisible(type): boolean

Whether marks of this type are currently drawn on the compass and listed in the map legend.

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.

boolean

True when they are shown.

moveWaypoint(position): boolean

Moves the marker the player has already dropped. It cannot create one, so it reads false when there is nothing down.

Vector3

Where to put it, in world-space metres. Nothing snaps it to the terrain.

boolean

True when there was a marker to move.

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.

boolean

True when the level’s fog took it; false before the level is up.

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.

Vector3

A world-space point; only x and y count.

boolean

True when the level’s fog took it; false before the level is up.

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.

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.

boolean

Whether marks of that type should be drawn.

boolean

True when the map page was there to take it.