Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CreateMapInstance

From RoR Wiki
Revision as of 19:41, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Interface functions
Version: WAR 1.4.8

Turns a MapDisplay window into a working map of the given type.

CreateMapInstance(windowName, mapType)

Arguments

windowName
string – Name of a MapDisplay window.
mapType
number – Kind of map, a value from SystemData.MapTypes (NORMAL, OVERHEAD, MAINMAP, RVRTRACKER, ...).

Returns

Nothing.

Details

  • The client creates map data of the requested type for the window. Afterwards MapSetMapView can choose what the window shows.
  • If windowName is empty, or the client's map data is not loaded, the call does nothing.
  • If the window does not exist, both errors below are logged.
  • The function needs at least two arguments and only reads the last two.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'CreateMapInstance': Display Window %s does not exist
  • Error in function call 'CreateMapInstance': Display Window %s is not a MapDisplay

Example

From ea_overheadmapwindow/source/overheadmapwindow.lua:

CreateMapInstance( "EA_Window_OverheadMapMapDisplay", SystemData.MapTypes.OVERHEAD )

From ea_worldmapwindow/source/zoneview.lua:

CreateMapInstance( "EA_Window_WorldMapZoneViewMapDisplay", SystemData.MapTypes.MAINMAP )

See also