Download
(16 Kb)
Download
Updated: 02/14/21 04:21 PM
Compatibility:
Flames of Ambition (6.3.5)
Markarth (6.2.5)
Stonethorn (6.1.5)
Greymoor (6.0.5)
Updated:02/14/21 04:21 PM
Created:04/26/19 08:13 PM
Monthly downloads:450
Total downloads:37,173
Favorites:6
MD5:
MapTables  Popular! (More than 5000 hits)
Version: 1.2.0
by: Drakanwulf, hawkeye1889
What It Is:
MapTables is a standalone support add-on that is used to dynamically create and/or update information, reference, and/or cross-reference tables for each and every one of the Maps in the game world. And then to save all that Map information so it does not have to be created again the next time you play ESO.

Unlike the game API functions, which operate on the current Map where the player (your character) is located, the MapTables API functions allow you to retrieve the same information for any Map, at anytime, regardless of where your character is located. Information can be retrieved either by Index or by Identifier and MapTables provides the cross-reference tables that help you switch from Index to Identifier.

MapTables uses LibGPS2 to accumulate and save all the coordinate information for every Map in the game the first time that you load it, or the first time after ZOS changes the game version or adds new Maps, or I enhance or correct the MapTables code, or you delete the .lua file in the game's .../SavedVariables/... directory. All this is done automagically without any prompting from you.

Because MapTables saves its tables, after they have been created or updated, neither MapTables nor LibGPS2 have to repeat that tedious and time consuming code the second and successive times you play the game... until ZOS or you change their environments.

Because it is a support add-on, MapTables has been designed for use by developers rather than users. The reason we developed MapTables and are developing its two relatives, ZoneTables and QuestTables, is so you don't have to hard-code Map, Zone, POI, or Quest tables any more!

"Standalone" means that MapTables should not be embedded. Please load only one instance of MapTables from your ".../Addons/" directory and add a "##DependsOn: MapTables" directive to your add-on's manifest file to instruct the game to verify that a MapTables process exists and is running before the game loads your add-on.

WARNING: You must be running ESO game code for the Wrathstone API (100026), or greater, for this add-on to function correctly.

What It Does:
MapTables creates its reference tables dynamically every time: the game changes its APIVersion number; MapTables changes its AddOnVersion number; MapTables detects missing or empty Maps tables; or, the game adds new or deletes old maps. Otherwise, MapTables retrieves the most current reference tables from its saved variables file. If MapTables finds any discrepancies, it automatically reloads or updates all its tables.

MapTables uses Map Indexes and Map Identifiers to access its reference tables just like the game does. In fact, most if not all of the MapTables indexes and identifiers use the same values the game does. The difference is that MapTables creates several index to identifier and identifier to index cross-reference tables that are not visible to the add-on developer in the game's version 100026 API functions.

MapTables uses game API functions to automatically create and maintain reference and/or cross-reference tables for each and every Map in the game:
  • It creates new or updates existing reference table entries by iterating through every Map index (e.g. 1 (Tamriel) through the current maximum number of Maps in the game (See the game GetNumMaps() API function).
  • It creates new or updates existing reference tables for which the game API functions return information that the MapTables API functions require.
  • It creates Information and Location reference tables for every Map.
  • It creates Map Name to Map Index reference tables.
  • It creates a Map Index to Zone Identifier cross-reference table.
  • It creates Map Identifier to Map Name and Map Name to Map Identifier reference tables that the game API does not provide currently (as of 100026).
  • It creates Map Index to Map Identifier and Map Identifier to Map Index cross-reference tables that the game API does not provide currently (as of 100026).
Please use the Comments tab to report MapTables bugs or to request MapTables enhancements.

What It Uses:
Please use ESOUI (or Minion) to download and install these library add-ons BEFORE you download and install MapsTables.

* LibAddOnMenu-2.0
* LibGPS2
* LibManifest
* LibMapPing

MapTables uses LibManifest to retrieve and save its AddOnVersion: number to determine whether the code has been changed or not.

MapTables uses LibGPS2 and its dependencies (e.g. LibMapPing, LibAddOnMenu-2.0, etc.) to generate and return global x, y location coordinates for the top left corner of each map according to its relative position inside of, or outside of, the Tamriel map.

MapTables uses the SetMapToMapListIndex(luaindex index) game API function to iterate through the game's list of active Maps to make each iteration the current Map so LibGPS2 can measure it.

MapTables uses but does not duplicate existing game API functions like:
  • GetCyrodiilMapIndex()
  • GetImperialCityMapIndex()
  • GetMapNameByIndex(luaindex mapIndex)
  • GetAutoMapNavigationCommonZoomOutMapIndex()
  • SetMapToMapListIndex(luaindex index)
  • GetMapNumTilesForMapId(integer mapId)
  • GetMapTileTextureForMapId(integer mapId, luaindex tileIndex)
  • GetCurrentMapId()
  • GetCurrentMapIndex()
  • GetMapName()
API Functions:
This is the list of MapTables API functions; we expect this list to grow and change as the game matures. Please use this link to refer to the MapTables documentation wiki to get all the information about MapTables, its API functions, their input parameters, and their return values.

Get the content type for this Map
Lua Code:
  1. function MapTables:GetContentType( mapIndex: number )
  2.     return infoByIndex[mapIndex].content or nil
  3. end
Get the global x,y coordinates for this Map
Lua Code:
  1. function MapTables:GetCoord( mapIndex: number )
  2.     return coordByIndex[mapIndex][1] or nil, coordByIndex[mapIndex][2] or nil
  3. end
Get the Map Identifier for this Map Index
Lua Code:
  1. function MapTables:GetIdByIndex( mapIndex: number )
  2.     return mapIdByIndex[mapIndex] or nil
  3. end
Get the Map Identifier for this Map Name
Lua Code:
  1. function MapTables:GetIdByName( mapName: string )
  2.     return mapIdByName[mapName] or nil
  3. end
Get the Map Index for this Map Name
Lua Code:
  1. function MapTables:GetIndex( mapName: string )
  2.     return indexByName[mapName] or nil
  3. end
Get the Map Index for this Map Identifier
Lua Code:
  1. function MapTables:GetIndexById( mapId: number )
  2.     return indexByMapId[mapId] or nil
  3. end
Get the Map Type for this Map
Lua Code:
  1. function MapTables:GetMapType( mapIndex: number )
  2.     return infoByIndex[mapIndex].mapType or nil
  3. end
Get the Map Name for this Map Identifier
Lua Code:
  1. function MapTables:GetNameById( mapId: number )
  2.     return nameByMapId[mapId] or nil
  3. end
Get the Zone Identifier for this Map
Lua Code:
  1. function MapTables:GetZoneId( mapIndex: number )
  2.     return zoneIdByIndex[mapIndex] or nil
  3. end

WARNING: Because the game handles the "Tamriel" and "The Aurbis" maps differently, it is possible for the MapTables API functions to return nil or zero (0) values. For these reasons, I believe you will find that some cross-reference tables are missing entries for indexes (1) and (24) (i.e. the Map Indexes for the "Tamriel" and "The Aurbis" maps).

Examples:
This code snippet illustrates the start up interactions between the game, MapTables, and their resultant error messages.

Lua Code:
  1. --[[-------------------------------------------------------------------------------------------------------------------
  2. Local variables shared by multiple functions within this add-on.
  3. ---------------------------------------------------------------------------------------------------------------------]]
  4. local ADDON_NAME = "MapTables"          -- The name of this add-on
  5. local addon = {}                        -- Every add-on control entry begins as an empty table
  6.  
  7. --[[-------------------------------------------------------------------------------------------------------------------
  8. Bootstrap code to load this add-on.
  9. ---------------------------------------------------------------------------------------------------------------------]]
  10. assert( not _G[ADDON_NAME], ADDON_NAME.. ": This add-on is already loaded. Do NOT load it multiple times!" )
  11.  
  12. _G[ADDON_NAME] = addon
  13. assert( _G[ADDON_NAME], ADDON_NAME.. ": the game failed to create a control entry!" )
  14. --[[-------------------------------------------------------------------------------------------------------------------
  15. ... And add-on initialization continues on from here...
  16. ---------------------------------------------------------------------------------------------------------------------]]
These code snippets illustrate the start up interactions between the game, MapTables, LibManifest, LibGPS2, and their resultant error messages, if any.
Lua Code:
  1. --[[-------------------------------------------------------------------------------------------------------------------
  2. Get the MapTables manifest information and update our control entry with it. Necessary to get the AddOnVersion: directive value.
  3. ---------------------------------------------------------------------------------------------------------------------]]
  4. local LM = LibManifest
  5. assert( LM, ADDON_NAME..  ": Failed! Could not find a running LibManifest." )
  6.  
  7. local manifest = {
  8.     -- These values are retrieved from existing manifest directives
  9.     author,         -- From the Author: directive Without any special characters
  10.     description,    -- From the Description: directive
  11.     fileName,       -- The name of this add-on's folder and manifest file
  12.     isEnabled,      -- ESO boolean value
  13.     isOutOfDate,    -- ESO boolean value
  14.     loadState,      -- ESO load state (i.e. loaded; not loaded)
  15.     title,          -- From the Title: directive without any special characters
  16.  
  17.     -- These values are retrieved from 100026 manifest directives
  18.     addOnVersion,   -- From the AddOnVersion: directive
  19.     filePath,       -- Path to this add-on's folder/directory
  20.  
  21.     -- These values are retrieved from 100027 manifest directives
  22.     isLibrary,      -- From the IsLibrary: directive
  23. }
  24.                
  25. manifest = LM:Create( ADDON_NAME )
  26. assert( manifest, ADDON_NAME.. ": LibManifest did not return an information table!" )
Lua Code:
  1. --[[-------------------------------------------------------------------------------------------------------------------
  2. Obtain a local link to "LibGPS2" and define a measurements table for its use.
  3. ---------------------------------------------------------------------------------------------------------------------]]
  4. local GPS = LibGPS2
  5. assert( GPS, ADDON_NAME.. ": Failed! Could not find a running LibGPS2." )
  6.  
  7. local measurement = {
  8.     scaleX = 0,
  9.     scaleY = 0,
  10.     offsetX = 0,
  11.     offsetY = 0,
  12.     mapIndex = 0,
  13.     zoneIndex = 0,
  14. }
Lua Code:
  1. -- Wait for a player to become active; LibGPS2 needs this
  2. EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_PLAYER_ACTIVATED,
  3.     function( event, initial )
  4.         EVENT_MANAGER:UnregisterForEvent( ADDON_NAME, EVENT_PLAYER_ACTIVATED )
  5.     end
  6. )
  7. assert( GPS:IsReady(), ADDON_NAME.. ": LibGPS2 cannot function until a player is active!" )
Lua Code:
  1. --[[-------------------------------------------------------------------------------------------------------------------
  2. And the last thing we do in this add-on is to wait for ESO to notify us that our add-on modules and support
  3. add-ons (i.e. libraries) have been loaded.
  4. ---------------------------------------------------------------------------------------------------------------------]]
  5. EVENT_MANAGER:RegisterForEvent( ADDON_NAME, EVENT_ADD_ON_LOADED, OnAddonLoaded )
1.2.0 - 14February2021 Happy Valentines Day!
Updated the APIVersion to 100033 even though this is not needed as this add-on updates its Map tables automatically with no input from you unless the AddOnVersion changes to indicate that the Elder Scrolls Map table processing logic has been changed. In other words, if the AddOnVersion has not changed, normal Map table addition and deletion maintenance caused by DLC and Chapter changes is handled routinely!

1.2.0 - 22June2019
Updated the Description page to clarify what this add-on does and to remove superfluous information that is already in the referenced wiki.

1.2.0 - 5June2019
Structural improvements to improve processing speed and to reduce execution time.
1. Localized some of the game API functions for speed.
2. Eliminated the update logic. It was redundant and no longer needed.
3. Changed the reload logic so that the "no changes" path bypassed all the Saved Variables table updates and file writes.

1.1.1 - 25May2019
Changed the SavedVariables: table names in the code and manifest files to use a "MapTables" prefix to prevent stepping on anyone else's Saved Variables file and/or table names by accident because I did it to myself while testing another add-on.

Moved the "local addon = {}" table declaration out of the bootstrap section and into the add-on wide local declarations section because the variable name "addon" is used by code lines in several different parts of the add-on. The BootStrap section is now a 4-line code snippet.

Verified, to the best of my limited knowledge, that MapTables does not duplicate any of the game's API functions. There are similar MapTables API function calls but the difference is MapTables lets you specify the Map you are interested in where the game API functions apply only to the current Map.

1.1.0 - 07May2019
Removed the "AddonStub" support add-on and replaced its loading functions with a 5-line code snippet.
Replaced the "strformat" functions with "assert" functions for speed and simplicity.

Look for a new "LibManifest" function to replace parts of what "AddonStub" used to do.

1.0.0 - 26April2019
Original release.
Archived Files (2)
File Name
Version
Size
Uploader
Date
1.2.0
17kB
Drakanwulf
06/05/19 07:05 PM
1.1.1
17kB
Drakanwulf
05/25/19 03:25 PM


There have been no comments posted to this file.
Be the first to add one.



Category Jump: