Skip to content

RevealPlayerMap

Shows one player the whole world map, without the fog of war.

For a server that keeps the game’s fog of war over the parts of the map a player has not walked (map_fog = true under [ui] in server.toml) and lifts it for someone - a map bought, a quest done. Without the fog (the default) every player’s map shows everything from the start and this changes nothing. It works one way: a revealed map cannot be clouded again, and a player who comes back in a new game has the fog again, so call it again (from OnPlayerSpawn, say). A player still loading gets the whole map as soon as they are in the world. "places" (or "all") also asks the player’s game to find the places of the level, so the revealed map shows their names (what a player discovered); no player’s game does that part in this version, and the map is revealed without the names.

RevealPlayerMap(pid [, what])
Parameter Type
pid number the player
what string | nil "places" or "all" to ask for the places too; anything else, or nothing, reveals the map alone (optional)

boolean - false when there is no such player

-- a map from the cartographer for 20 Groschen
if cmd == "/buymap" and GetPlayerMoney(pid) >= 20 then
GivePlayerMoney(pid, -20)
RevealPlayerMap(pid)
SendClientMessage(pid, COLOR_WHITE, "The map shows the whole land now.")
return true
end

OnPlayerSpawn · CreateMarker · the Compass markers group of the index