Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:MapGetChildMaps

From RoR Wiki

UI Lua API · Map functions
Version: WAR 1.4.8

Returns the maps one level below a given map, for example the zone maps of a pairing map.

children = MapGetChildMaps(mapLevel, mapNumber)

Arguments

mapLevel
number – Level of the map, a GameDefs.MapLevel value (WORLD_MAP, PAIRING_MAP, ZONE_MAP, AREA_MAP).
mapNumber
number – Number of the map at that level, for example a zone id for ZONE_MAP.

Returns

children
table – Array of child maps, indexed from 1, or nothing if the map is not in the client's map data.

Each entry:

Key Type Meaning
mapLevel number Level of the child map.
mapNumber number Number of the child map.

Details

  • A map without children returns an empty table.
  • If the client's map data is not loaded, the function returns nothing.
  • The stock UI never calls this function.
  • The function needs at least two arguments and only reads the last two.

Errors

None besides the generic Invalid Parameters message when an argument is missing or not a number.

Example

A minimal example built from the signature:

local children = MapGetChildMaps( GameDefs.MapLevel.PAIRING_MAP, pairingMapNumber )
if children ~= nil then
    for _, child in ipairs( children ) do
        -- child.mapLevel, child.mapNumber
    end
end

See also