WorldMap

Client only. The map screen on this machine and the player's own waypoint. Mark categories are the game's compass and map mark types by name, such as Smithy, Pub, Bed, Shrine, Camp, FishingSpot, HuntingSpot, Baths, Barber, DiceTable, Arena, SkillTeacher, Grave and GeneralPoi. None of this reaches other players.

worldMap.isOpen

isOpen

Whether the map screen is open.

worldMap.getWaypoint()

WorldMap.getWaypoint()

The player's waypoint as { position, mapId }, or null if none is set.

worldMap.shiftWaypoint()

WorldMap.shiftWaypoint(position)

Moves the player's waypoint. Returns false if none is set.

worldMap.mapCategoryShown()

WorldMap.mapCategoryShown(type)

Whether a mark category shows on the map and compass.

worldMap.setMapCategory()

WorldMap.setMapCategory(type, visible)

Shows or hides a mark category on the map and compass.

worldMap.clearWaypoint()

WorldMap.clearWaypoint()

Removes the player's waypoint. Returns false if none is set.

worldMap.clearAllFog()

WorldMap.clearAllFog()

Removes all map fog in the level for this player, leaving discovery alone. By default a KCDS server already lifts fog as the world loads, so this is for servers keeping the fog. A level load brings fog back. Returns false before the level is up.

worldMap.discover()

WorldMap.discover(id)

Discovers a place on this player's map with no notification, XP or game trigger. Sessions start with an unexplored map, so use it to restore a saved character's discoveries after loading. A point of interest fires poiDiscovered, while a location such as a town or district fires nothing. Returns true if the id belongs to the current level, even if already discovered, and false for other ids or before the level has loaded. Throws a TypeError for anything except a LocationId.

worldMap.clearFog()

WorldMap.clearFog(position)

Removes fog around a point for this player with the radius of visiting it, without discovering anything. Use it to restore a saved character's explored areas after loading. It only has an effect when the server's revealMap is off, and fog returns on the next level load. Returns false before the level is up, and throws a TypeError for a position without finite x and y.