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-falseshows it to nobody untilSetMapIconVisibleFor(trueby 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.
Syntax
Section titled “Syntax”CreateMapIcon(x, y, z, opts)| Parameter | Type | |
|---|---|---|
x |
number | metres |
y |
number | metres |
z |
number | metres |
opts |
table | the options above |
Returns
Section titled “Returns”number - the icon’s id; nil and the reason
Example
Section titled “Example”function OnGameModeInit() CreateMapIcon(3136.2, 735.1, 55, {type = "tailor", name = "Agnes's Fine Cloth"})endSee also
Section titled “See also”SetMapIcon · DeleteMapIcon · SetMapIconVisibleFor · HideLevelMapIcons · the Map icons group of the index
