Download
(11 Kb)
Download
Updated: 11/01/21 09:46 AM
Compatibility:
Deadlands (7.2.5)
Updated:11/01/21 09:46 AM
Created:02/20/16 11:34 AM
Monthly downloads:22,588
Total downloads:2,197,200
Favorites:1,524
MD5:
LibMapPing  Popular! (More than 5000 hits)
Version: 2.0.0
by: sirinsidiator, votan
This library is an abstraction for the different types of player set pings on the map. Not to be confused with LibMapPins which handles creation of custom map markers.
The main features include:
  • a unified way to manipulate pings and to react to the ensuing map ping events,
  • suppression of pings so that their information can only be accessed via the library,
  • silent placement of pings,
  • watch dog that fires the callbacks if an event does not get fired by the API due to a bug.

Dependencies
Make sure to install the following required libraries in order to use LibMapPing.
API Reference

MapPingState
MapPingState is an enumeration of the possible states of a map ping.
lib.MAP_PING_NOT_SET: There is no ping.
lib.MAP_PING_NOT_SET_PENDING: The ping has been removed, but EVENT_MAP_PING has not been processed.
lib.MAP_PING_SET_PENDING: A ping was added, but EVENT_MAP_PING has not been processed.
lib.MAP_PING_SET: There is a ping.

SetMapPing
Wrapper for PingMap and SetPlayerWaypointByWorldLocation.
pingType is one of the three possible MapDisplayPinType for map pings (MAP_PIN_TYPE_PLAYER_WAYPOINT, MAP_PIN_TYPE_PING or MAP_PIN_TYPE_RALLY_POINT) or false.
when pingType is set to false, the function calls SetPlayerWaypointByWorldLocation and the arguments will be the worldX, worldY and worldZ and the return a boolean success
for all other pingTypes nothing is returned and the arguments are as follows:
mapType is usually MAP_TYPE_LOCATION_CENTERED.
x and y are the normalized coordinates on the current map.
Code:
lib:SetMapPing(MapDisplayPinType pingType, MapDisplayType|number mapTypeOrWorldX, number xOrWorldY, number yOrWorldZ)
RemoveMapPing
Wrapper for the different ping removal functions.
For waypoints and rally points it calls their respective removal function.
For group pings it just sets the position to 0, 0 as there is no function to clear them.
Code:
lib:RemoveMapPing(MapDisplayPinType pingType)
GetMapPing
Wrapper for the different get ping functions. Returns coordinates regardless of their suppression state.
The game API functions return 0, 0 when the ping type is suppressed.
pingType is the same as for SetMapPing.
pingTag is optionally used if another group member's MAP_PIN_TYPE_PING should be returned (possible values: group1 .. group24).
Code:
number x, number y = lib:GetMapPing(MapDisplayPinType pingType[, string pingTag])
GetMapPingState
Returns the MapPingState for the pingType and pingTag.
Code:
MapPingState state = lib:GetMapPingState(MapDisplayPinType pingType[, string pingTag])
HasMapPing
Returns true if ping state is lib.MAP_PING_SET_PENDING or lib.MAP_PING_SET.
Code:
boolean hasPing = lib:HasMapPing(MapDisplayPinType pingType[, string pingTag])
RefreshMapPin
Refreshes the pin icon for the pingType on the worldmap.
Returns true if the pin has been refreshed.
Code:
boolean wasRefreshed = lib:RefreshMapPin(MapDisplayPinType pingType[, string pingTag])
IsPositionOnMap
Returns true if the normalized position is within 0 and 1.
Code:
boolean isInside = lib:IsPositionOnMap(number x, number y)
MutePing
Mutes the map ping of the specified type, so it does not make a sound when it is set.
Do not forget to call UnmutePing later, otherwise the sound will be permanently muted!
Code:
lib:MutePing(MapDisplayPinType pingType[, string pingTag])
UnmutePing
Unmutes the map ping of the specified type.
Do not call this more often than you called MutePing, or you might interfere with other addons.
The sounds are played between the BeforePing* and AfterPing* callbacks are fired.
Code:
lib:UnmutePing(MapDisplayPinType pingType[, string pingTag])
IsPingMuted
Returns true if the map ping has been muted.
Code:
boolean isMuted = lib:IsPingMuted(MapDisplayPinType pingType[, string pingTag])
SuppressPing
Suppresses the map ping of the specified type, so that it neither makes a sound nor shows up on the map.
This also makes the API functions return 0, 0 for that ping.
In order to access the actual coordinates lib:GetMapPing has to be used.
Do not forget to call UnsuppressPing later, otherwise map pings won't work anymore for the user and other addons!
Code:
lib:SuppressPing(MapDisplayPinType pingType[, string pingTag])
UnsuppressPing
Unsuppresses the map ping so it shows up again.
Do not call this more often than you called SuppressPing, or you might interfere with other addons.
Code:
lib:UnsuppressPing(MapDisplayPinType pingType[, string pingTag])
IsPingSuppressed
Returns true if the map ping has been suppressed.
Code:
boolean isSuppressed = lib:IsPingSuppressed(MapDisplayPinType pingType[, string pingTag])
RegisterCallback
Register to callbacks from the library.
Valid events are BeforePingAdded, AfterPingAdded, BeforePingRemoved and AfterPingRemoved.
These are fired at certain points during handling EVENT_MAP_PING.
Code:
lib:RegisterCallback(string eventName, function callback)
UnregisterCallback
Unregister from callbacks. See lib:RegisterCallback.
Code:
lib:UnregisterCallback(string eventName, function callback)
BeforePingAdded
This callback is fired in EVENT_MAP_PING before the map ping is processed.
Code:
BeforePingAdded(MapDisplayPinType pingType, string pingTag, number x, number y, boolean isPingOwner)
AfterPingAdded
This callback is fired in EVENT_MAP_PING after the map ping has been processed.
Code:
AfterPingAdded(MapDisplayPinType pingType, string pingTag, number x, number y, boolean isPingOwner)
BeforePingRemoved
This callback is fired in EVENT_MAP_PING before the map ping is processed.
Code:
BeforePingRemoved(MapDisplayPinType pingType, string pingTag, number x, number y, boolean isPingOwner)
AfterPingRemoved
This callback is fired in EVENT_MAP_PING after the map ping has been processed.
Code:
AfterPingRemoved(MapDisplayPinType pingType, string pingTag, number x, number y, boolean isPingOwner)
version 2.0.0 - sirinsidiator
  • added support for SetPlayerWaypointByWorldLocation
  • updated to latest library standards and semantic versioning
  • made LibDebugLogger a required dependency
  • updated for Deadlands

version 1.0 r12 - sirinsidiator
  • fixed errors when either LibStub or LibDebugLogger is not loaded

version 1.0 r11 - sirinsidiator
  • fixed error when LibStub is loaded

version 1.0 r10 - sirinsidiator
  • switched to LibDebugLogger for debug output
  • removed LibStub and made its usage optional
  • updated API version in manifest

version 1.0 r9 - votan
  • Update to API 100027 "Elsweyr".

version 1.0 r8 - sirinsidiator
  • removed debug output (thanks Sordrak)

version 1.0 r7 - sirinsidiator
  • added protection to drop group pings that would cause a player to get kicked (only relevant when you use LibGroupSocket with many addons that send data)
  • updated API version in manifest

version 1.0 r6 - votan
  • Fixed map ping events can cause wrong waypoint/rally pins in combination with addons changing the current map
  • updated API version in manifest

version 1.0 r5 - sirinsidiator
  • fixed an issue where the initial state of the player waypoint is discarded on ui load in combination with LibGPS
  • updated API version in manifest

version 1.0 r4 - sirinsidiator
  • fixed an error when trying to set a group ping while not in a group
  • added watchdog that fires the callbacks and resets mute and suppress counts when the EVENT_MAP_PING does not get fired by the API in response to a waypoint being set by the player
Optional Files (0)


Archived Files (10)
File Name
Version
Size
Uploader
Date
1.0 r12
8kB
sirinsidiator
02/27/20 01:50 PM
1.0 r11
8kB
sirinsidiator
02/26/20 04:13 PM
10
8kB
sirinsidiator
02/26/20 03:20 PM
9
9kB
sirinsidiator
05/15/19 01:13 PM
r8
17kB
sirinsidiator
07/03/18 06:54 AM
r7
9kB
sirinsidiator
06/24/18 03:29 AM
r6
9kB
sirinsidiator
11/11/17 07:54 AM
r5
9kB
sirinsidiator
07/14/16 02:45 PM
r4
8kB
sirinsidiator
03/19/16 08:59 AM
r3
8kB
sirinsidiator
02/20/16 11:34 AM


Post A Reply Comment Options
Unread 08/04/23, 02:58 AM  
Cavanoskus
Premium Member
 
Cavanoskus's Avatar
Premium Member

Forum posts: 13
File comments: 49
Uploads: 0
I'm getting a lua error that directly mentions this addon as well as the updated Fyrakin's MiniMap addon, and seems to trigger when the Community Guides addon places a pin on the map. So with 2 different addons directly named in the error, and the error's occurrence tied to a third addon, I'm not sure who to report this to other than to post on all three addon pages.

Community Guides places an X marker on the map to show you where to go next, and this error pops up when that marker is placed. However, it doesn't happen every single time. I got hit with about 13 in a row doing the Cyrodiil tutorial on an EP character. Here's the error, spoilered for length (they're not all completely identical but they all look like this):

Warning: Spoiler
Report comment to moderator  
Reply With Quote
Unread 08/19/21, 10:11 AM  
Anceane
 
Anceane's Avatar
AddOn Author - Click to view AddOns

Forum posts: 306
File comments: 1017
Uploads: 1
Hello,

Travelling from Blackwwod city to Pantherfang House (owned), gave me this error.

As it mentionned this library and the addon Beammeup, i will post the error in both places.



Code:
user:/AddOns/LibMapPing/LibMapPing.lua:61: operator + is not supported for nil + number
stack traceback:
user:/AddOns/LibMapPing/LibMapPing.lua:61: in function 'RollingAverage:Increment'
|caaaaaa<Locals> self = [table:1]{timeframe = 3, resolution = 10, count = 30, lastIndex = 0}, index = 0 </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:113: in function 'LeakyBucket:Take'
|caaaaaa<Locals> self = [table:2]{generatedTokens = 1.953125, safetyThreshold = 10, lastCheck = 7917092, left = 99, size = 100} </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:223: in function 'CustomPingMap'
|caaaaaa<Locals> pingType = 181, mapType = 1, x = 0.69650036096573, y = 0.21939116716385 </Locals>|r
user:/AddOns/BeamMeUp/core/List.lua:1341: in function 'Teleporter.clickOnZoneName'
|caaaaaa<Locals> button = 1, record = [table:3]{parentZoneId = 1261, zoneName = "Blackwood Chapel", displayName = "", houseBackgroundImage = "/esoui/art/store/pc_collection...", textColorZoneName = "|cFFFFFF", category = 3, nickName = "Blackwood Chapel", textColorDisplayName = "|c777777", parentZoneName = "Blackwood", zoneId = 1277, countRelatedQuests = 0, isOwnHouse = T, houseIcon = "/esoui/art/icons/housing_panth...", houseCategoryType = "Notable", mapIndex = 43, houseId = 89, prio = 2, collectibleId = 9412, zoneNameUnformatted = "Pantherfang Chapel", zoneNameClickable = T, countRelatedItems = 0}, toSearch = "Pantherfang Chapel", coordinate_x = 0, coordinate_z = 0, zoneIndex = 834, i = 55, e = [table:4]{linkedCollectibleIsLocked = F, finishedDescription = "", poiPinType = 40, icon = "/esoui/art/icons/poi/poi_group...", isShownInCurrentMap = T, normalizedX = 0.69650036096573, objectiveName = "Pantherfang Chapel", objectiveLevel = 0, normalizedZ = 0.21939116716385, startDescription = ""}, objectiveNameWithArticle = "pantherfang chapel", zoneNameWithArticle = "pantherfang chapel", objectiveNameWithoutArticle = "pantherfang chapel", zoneNameWithoutArcticle = "pantherfang chapel" </Locals>|r
user:/AddOns/BeamMeUp/core/List.lua:918: in function '(anonymous)'
|caaaaaa<Locals> self = ud, button = 1 </Locals>|r
Report comment to moderator  
Reply With Quote
Unread 04/25/21, 01:42 PM  
Orejana
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 50
Uploads: 2
Hey I got the following error on login:

Code:
user:/AddOns/LibMapPing/LibMapPing.lua:61: operator + is not supported for nil + number
stack traceback:
user:/AddOns/LibMapPing/LibMapPing.lua:61: in function 'RollingAverage:Increment'
|caaaaaa<Locals> self = [table:1]{lastIndex = 0, count = 30, timeframe = 3, resolution = 10}, index = 0 </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:113: in function 'LeakyBucket:Take'
|caaaaaa<Locals> self = [table:2]{safetyThreshold = 10, generatedTokens = 1.953125, lastCheck = 690093, size = 100, left = 99} </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:223: in function 'CustomPingMap'
|caaaaaa<Locals> pingType = 180, mapType = 1, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:276: in function 'lib:SetMapPing'
|caaaaaa<Locals> self = [table:3]{MAP_PING_SET = 3, MAP_PING_NOT_SET_PENDING = 1, MAP_PING_SET_PENDING = 2, MAP_PING_NOT_SET = 0}, pingType = 180, mapType = 1, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/HodorReflexes/modules/share/main.lua:318: in function 'SendData'
|caaaaaa<Locals> pingType = 0, ultType = 1, ult = 0, dmg = 0, dps = 0, shareHorn = F, shareColos = F, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/HodorReflexes/modules/share/main.lua:382: in function 'SendAttempt'
|caaaaaa<Locals> t = 690091 </Locals>|ruser:/AddOns/LibMapPing/LibMapPing.lua:61: operator + is not supported for nil + number
stack traceback:
user:/AddOns/LibMapPing/LibMapPing.lua:61: in function 'RollingAverage:Increment'
|caaaaaa<Locals> self = [table:1]{lastIndex = 0, count = 30, timeframe = 3, resolution = 10}, index = 0 </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:113: in function 'LeakyBucket:Take'
|caaaaaa<Locals> self = [table:2]{safetyThreshold = 10, generatedTokens = 1.953125, lastCheck = 690093, size = 100, left = 99} </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:223: in function 'CustomPingMap'
|caaaaaa<Locals> pingType = 180, mapType = 1, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/LibMapPing/LibMapPing.lua:276: in function 'lib:SetMapPing'
|caaaaaa<Locals> self = [table:3]{MAP_PING_SET = 3, MAP_PING_NOT_SET_PENDING = 1, MAP_PING_SET_PENDING = 2, MAP_PING_NOT_SET = 0}, pingType = 180, mapType = 1, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/HodorReflexes/modules/share/main.lua:318: in function 'SendData'
|caaaaaa<Locals> pingType = 0, ultType = 1, ult = 0, dmg = 0, dps = 0, shareHorn = F, shareColos = F, x = 0.50430044703534, y = 0.58864684813306 </Locals>|r
user:/AddOns/HodorReflexes/modules/share/main.lua:382: in function 'SendAttempt'
|caaaaaa<Locals> t = 690091 </Locals>|r
Would appreciate it if you could have a look Cheers!
Last edited by Orejana : 04/25/21 at 01:43 PM.
Report comment to moderator  
Reply With Quote
Unread 04/23/21, 12:58 AM  
votan
 
votan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 577
File comments: 1667
Uploads: 40
Originally Posted by snichols7778
EsoUI/Ingame/Map/WorldMap.lua:1550: table index is nil
stack traceback:
EsoUI/Ingame/Map/WorldMap.lua:1550: in function 'ZO_WorldMapPins:MapPinLookupToPinKey'
EsoUI/Ingame/Map/WorldMap.lua:1578: in function 'ZO_WorldMapPins:CreatePin'
user:/AddOns/LibMapPing/LibMapPing.lua:178: in function 'HandleMapPing'
user:/AddOns/LibMapPing/LibMapPing.lua:208: in function 'HandleMapPingEventNotFired'

this is with minimap delete
Could you enable details, please (Showing the variables)
Report comment to moderator  
Reply With Quote
Unread 04/22/21, 11:17 AM  
snichols7778

Forum posts: 7
File comments: 145
Uploads: 0
EsoUI/Ingame/Map/WorldMap.lua:1550: table index is nil
stack traceback:
EsoUI/Ingame/Map/WorldMap.lua:1550: in function 'ZO_WorldMapPins:MapPinLookupToPinKey'
EsoUI/Ingame/Map/WorldMap.lua:1578: in function 'ZO_WorldMapPins:CreatePin'
user:/AddOns/LibMapPing/LibMapPing.lua:178: in function 'HandleMapPing'
user:/AddOns/LibMapPing/LibMapPing.lua:208: in function 'HandleMapPingEventNotFired'

this is with minimap delete
Last edited by snichols7778 : 04/22/21 at 11:21 AM.
Report comment to moderator  
Reply With Quote
Unread 04/11/21, 01:06 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1566
File comments: 1120
Uploads: 41
Originally Posted by snichols7778
EsoUI/Ingame/Map/WorldMap.lua:1549: table index is nil
stack traceback:
EsoUI/Ingame/Map/WorldMap.lua:1549: in function 'ZO_WorldMapPins:MapPinLookupToPinKey'
EsoUI/Ingame/Map/WorldMap.lua:1577: in function 'ZO_WorldMapPins:CreatePin'
user:/AddOns/MiniMap/MiniMap.lua:5913: in function 'CreatePin'
user:/AddOns/LibMapPing/LibMapPing.lua:178: in function 'HandleMapPing'
user:/AddOns/LibMapPing/LibMapPing.lua:208: in function 'HandleMapPingEventNotFired'

only happens in Cyrodil
This looks like a problem in the MiniMap addon, so try reporting it there.
Report comment to moderator  
Reply With Quote
Unread 04/10/21, 09:28 PM  
snichols7778

Forum posts: 7
File comments: 145
Uploads: 0
EsoUI/Ingame/Map/WorldMap.lua:1549: table index is nil
stack traceback:
EsoUI/Ingame/Map/WorldMap.lua:1549: in function 'ZO_WorldMapPins:MapPinLookupToPinKey'
EsoUI/Ingame/Map/WorldMap.lua:1577: in function 'ZO_WorldMapPins:CreatePin'
user:/AddOns/MiniMap/MiniMap.lua:5913: in function 'CreatePin'
user:/AddOns/LibMapPing/LibMapPing.lua:178: in function 'HandleMapPing'
user:/AddOns/LibMapPing/LibMapPing.lua:208: in function 'HandleMapPingEventNotFired'

only happens in Cyrodil
Report comment to moderator  
Reply With Quote
Unread 01/17/21, 09:46 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1566
File comments: 1120
Uploads: 41
Originally Posted by JLE
So... how about updating this for Markarth, or even Greymoor?
Is anything not working?
Report comment to moderator  
Reply With Quote
Unread 01/17/21, 08:29 AM  
JLE

Forum posts: 0
File comments: 42
Uploads: 0
So... how about updating this for Markarth, or even Greymoor?
Report comment to moderator  
Reply With Quote
Unread 09/25/20, 02:01 AM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1566
File comments: 1120
Uploads: 41
Re: Map Popping Up

Originally Posted by Starckle
Hello! I installed this addon because it's a dependency for my other addon, LibGPS (which works for my Zygor leveling addon) ... I wasn't having issues with his addon before but the map keeps popping up randomly and will not go off unless I tap "M" a couple of times to get off. It also comes up during combat, and when I type / press enter after typing. Removing this particular addon fixes the issue but I really need to use Zygor.

Any ideas on what I can do?
This is a library. It doesn't have any functions of its own, but instead gets called by other addons. If you have problems like that, it's highly unlikely a library is at fault, but instead you should start looking at the addons that depend on it. When you disable a library, all addons that depend on it are disabled too, that's why you see the problem going away.
Report comment to moderator  
Reply With Quote
Unread 09/24/20, 10:47 PM  
Starckle

Forum posts: 0
File comments: 1
Uploads: 0
Smile Map Popping Up

Hello! I installed this addon because it's a dependency for my other addon, LibGPS (which works for my Zygor leveling addon) ... I wasn't having issues with his addon before but the map keeps popping up randomly and will not go off unless I tap "M" a couple of times to get off. It also comes up during combat, and when I type / press enter after typing. Removing this particular addon fixes the issue but I really need to use Zygor.

Any ideas on what I can do?
Report comment to moderator  
Reply With Quote
Unread 08/17/20, 12:30 PM  
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1566
File comments: 1120
Uploads: 41
Originally Posted by zerdax
It still says outdated. Any one managed to get them right?
This library is working fine. You just need to check the "allow outdated" checkbox in the addon menu
Report comment to moderator  
Reply With Quote
Unread 08/17/20, 11:15 AM  
zerdax

Forum posts: 0
File comments: 1
Uploads: 0
It still says outdated. Any one managed to get them right?
Report comment to moderator  
Reply With Quote
Unread 07/13/20, 08:40 PM  
TECHHNYNE

Forum posts: 0
File comments: 4
Uploads: 0
its saying libMapPing is missing but i have 3 files in a folder in my addon dir
Report comment to moderator  
Reply With Quote
Unread 07/10/20, 06:47 PM  
vizql

Forum posts: 0
File comments: 1
Uploads: 0
Ive only recently started modding ESO due to playing seriously now, its listed as out-of-date when loading up? I have installed the more recent version.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.