Thread Tools Display Modes
10/23/23, 11:05 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question GetTargetMountedStateInfo() issues

Ive had this function as part of my addon for nearly 9mo now with no issues but recently I began reworking the function to not just mount my "saved player @NAME" but anyoone in group that is riding a dual mount and has free pasenger slot. This is when I noticed this function is now returning true & true for GetTargetMountedStateInfo() even when noone is on a mount at all:

Code:
for iD = 1, GetGroupSize() do
		local playerID = GetGroupUnitTagByIndex(iD)
		local playerCharName = GetUnitName(playerID)
		local playerDisplayName = GetUnitDisplayName(playerID)
		local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
I tested this extensively 9mo ago when I 1st implemented it but now I cant seem to get it to return false ever which is needed. Any suggestions?

Last edited by sinnereso : 10/23/23 at 11:15 AM.
  Reply With Quote
10/23/23, 11:29 AM   #2
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Firstly be aware that function doesn't return the correct data when you are too far from the group member.
Secondly it still works properly in minimap by Fyrakin.

Try to verify what GetGroupUnitTagByIndex outputs because it does weird things sometimes.

EDIT:
Sorry I read too fast, I'm only using the 1st value returned and it works correctly, I don't know for value 2 and 3
GetTargetMountedStateInfo(*string* _characterOrDisplayName_)
** _Returns:_ *[MountedState|#MountedState]* _mountedState_, *bool* _isRidingGroupMount_, *bool* _hasFreePassengerSlot_

Last edited by Masteroshi430 : 10/23/23 at 11:33 AM.
  Reply With Quote
10/23/23, 11:50 AM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Masteroshi430 View Post
Firstly be aware that function doesn't return the correct data when you are too far from the group member.
Secondly it still works properly in minimap by Fyrakin.

Try to verify what GetGroupUnitTagByIndex outputs because it does weird things sometimes.

EDIT:
Sorry I read too fast, I'm only using the 1st value returned and it works correctly, I don't know for value 2 and 3
GetTargetMountedStateInfo(*string* _characterOrDisplayName_)
** _Returns:_ *[MountedState|#MountedState]* _mountedState_, *bool* _isRidingGroupMount_, *bool* _hasFreePassengerSlot_
It used to work perfectly. Ive had my addon setup to handle "saved" player" not being mounted on dual mount and with a passenger already using this function even when out of range but now its returning true for every single group member in testing when noone is mounted at all, inrange and not inrange.
  Reply With Quote
10/23/23, 11:52 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Moved the thread as this is a question about a lua API function (even if referenced to an already released addon the forum "Released addons" is for "Addon-specific support threads created by their authors").

Edit:
Did you check via d() messages if the playerID of the unit and the displayNames are the correct/expected ones?
Maybe it always passes in the same id/account, or some nil value and thus returns true

Last edited by Baertram : 10/23/23 at 11:55 AM.
  Reply With Quote
10/23/23, 12:04 PM   #5
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Baertram View Post
Moved the thread as this is a question about a lua API function (even if referenced to an already released addon the forum "Released addons" is for "Addon-specific support threads created by their authors").

Edit:
Did you check via d() messages if the playerID of the unit and the displayNames are the correct/expected ones?
Maybe it always passes in the same id/account, or some nil value and thus returns true

just tested:

Code:
for iD = 1, GetGroupSize() do
		local playerID = GetGroupUnitTagByIndex(iD)
		local playerCharName = GetUnitName(playerID)
		local playerDisplayName = GetUnitDisplayName(playerID)
		local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
                df(RidinDirty.logo .. " " .. tostring(playerDisplayName) .. " - " .. tostring(playerCharName) ..  " - " .. tostring(playerID) .. " - " .. tostring(isRidingGroupMount) .. " - " .. tostring(hasFreePassengerSlot))--TEST
and its outputting:
Code:
@NAME - charname - group1 - true - true
@NAME - charname - group2 - true - true
@NAME - charname - group3 - true - true
when were all standing near eachother unmounted. Everything is correct including @names and charnames except the true - true which should be false - false

Last edited by sinnereso : 10/23/23 at 12:06 PM.
  Reply With Quote
10/23/23, 12:12 PM   #6
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Baertram View Post
Moved the thread as this is a question about a lua API function (even if referenced to an already released addon the forum "Released addons" is for "Addon-specific support threads created by their authors").

Edit:
Did you check via d() messages if the playerID of the unit and the displayNames are the correct/expected ones?
Maybe it always passes in the same id/account, or some nil value and thus returns true
OK just found the issue with the function... its returning TRUE TRUE for anyone in the group that has enabled a dual mount in there collections ONLY.. even while not even mounted it returns true true if they have one enabled to be used.. if they change theyre mount to a standard mount it returns false false. this is all while noone has even got on any mounts, just changing the mount you wish to use in your collections triggers it true or false.

This likly showed up maybe when the new mount favourites feature was added as it did work properly this spring. I know this because it was my very 1st feature and the very original purpose of RidinDirty.

Last edited by sinnereso : 10/23/23 at 12:29 PM.
  Reply With Quote
10/23/23, 01:17 PM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Maybe you need to combine the 1st return param with the others then.
If 1st MountedState is unmounted -> ignore 2nd and 3rd param!

And if 1st param says "mounted" then only consider the snd and 3rd param
  Reply With Quote
10/24/23, 01:53 AM   #8
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Baertram View Post
Maybe you need to combine the 1st return param with the others then.
If 1st MountedState is unmounted -> ignore 2nd and 3rd param!

And if 1st param says "mounted" then only consider the snd and 3rd param
well that may help but if your standing around near a wayshrine are you isRidingGroupMount and do you hasFreePassengerSlot? theyre clearly not currently working as intended anymore imo. They used to because I had chat output handlers for these scenarios that no longer function as intended.

Last edited by sinnereso : 10/24/23 at 02:33 AM.
  Reply With Quote
10/24/23, 08:05 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Okay, if it's a bug you could describe it here with simple example and expected result, and question ZOs if this is known and needs a fix:
https://www.esoui.com/forums/forumdisplay.php?f=187
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » GetTargetMountedStateInfo() issues


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