Thread Tools Display Modes
01/16/23, 06:00 AM   #1
Splat
AddOn Author - Click to view addons
Join Date: May 2019
Posts: 7
Mounted player in group

Is it possible to detect if a member of a group has mounted/dismounted?

I know you can detect individually but I need the addon to fire when anyone in my group mounts or dismounts

Thanks
  Reply With Quote
01/16/23, 06:07 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
No, this is only possible for your own via the event EVENT_MOUNTED_STATE_CHANGED

If anyone in group dismountes/mounts there won't be fired any event or callback.
You could check that with an EVENT_MANAGER:RegisterForUpdate every 1 second e.g., but this may become performance hungry
https://wiki.esoui.com/Running_LUA-C...isterForUpdate

But: I think there is no API to check for IsMounted(unitTag), there only exists IsMounted() for the own player, isn't it? So this would not be possible at all as it seems.



If you are grouped there always exists the way to send small data between players "who use the same addon" ia map pings. But this is a workaround that quite a lot addons use already and if you add to that emthod the server might kick you for server message spamming! So I would only do this if really needed.
At best read about it here at the lib LibGroupSocket:
https://www.esoui.com/downloads/info...oupSocket.html

This way each addon where an EVENT_MOUNTED_STATE_CHANGED fires could broadcast that info together with the unittag's index (2 -> which makes "group2" as unitTag in the end) and teh mounted state (1 for true, 0 for false e.g. -> use 1 here) to the other grup members and the ones using the same addon could use the index 2 -> create "group2" and then know that GetUnitName("group2") has mouted (state 1) currently.
But as I said: If 1 group members all mount at once and all is send to each other because all use that addon: You might get kicked which is not that nice within a raid/trial e.g. So this is nothing one should use for every aspect and nice "feature".

Last edited by Baertram : 01/16/23 at 06:15 AM.
  Reply With Quote
01/16/23, 11:28 AM   #3
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by Baertram View Post
I think there is no API to check for IsMounted(unitTag), there only exists IsMounted() for the own player, isn't it? So this would not be possible at all as it seems.
It works, I use it in minimap by Fyrakin, mounted group members have a horse icon
Lua Code:
  1. isMounted = GetTargetMountedStateInfo(GetRawUnitName(tag)) ~= MOUNTED_STATE_NOT_MOUNTED

(tag is the group tag of course)

Last edited by Masteroshi430 : 01/16/23 at 11:39 AM.
  Reply With Quote
01/16/23, 04:04 PM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Thanks for the details, learned again
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Mounted player in group

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off