Skip to content

CreateMapIcon

An icon of the game’s own kind on the world map and the compass.

opts:

  • type - a map icon type’s name ("tailor", "blacksmith", "pub" …) or its GUID: its icon and its legend name;
  • icon - the legend’s icon number instead of the type’s;
  • name - the name on the map ("": the type’s legend name);
  • visible - false shows it to nobody until SetMapIconVisibleFor (true by default).

An icon needs a picture: a type with one, or an icon number. The level’s map shows only the kinds its legend has (the monastery’s map has no shops - a pin or a camp shows anywhere). At most 1024 icons.

CreateMapIcon(x, y, z, opts)
Parameter Type
x number metres
y number metres
z number metres
opts table the options above

number - the icon’s id; nil and the reason

function OnGameModeInit()
CreateMapIcon(3136.2, 735.1, 55, {type = "tailor", name = "Agnes's Fine Cloth"})
end

SetMapIcon · DeleteMapIcon · SetMapIconVisibleFor · HideLevelMapIcons · the Map icons group of the index