Thread Tools Display Modes
10/24/23, 04:25 PM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Exclamation [notabug]GetTargetMountedStateInfo() issues

Code:
local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
Returns true / true for isRidingGroupMount / hasFreePassengerSlot when the "playerDisplayName" has ONLY selected a dual rider mount in collections and is NOT mounted.

Will return false / false ONLY if "playerDisplayName" has a regular single seat mount selected in collections.
  Reply With Quote
10/25/23, 12:06 PM   #2
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 181
Originally Posted by sinnereso View Post
Code:
local _, isRidingGroupMount, hasFreePassengerSlot = GetTargetMountedStateInfo(playerDisplayName)
Returns true / true for isRidingGroupMount / hasFreePassengerSlot when the "playerDisplayName" has ONLY selected a dual rider mount in collections and is NOT mounted.

Will return false / false ONLY if "playerDisplayName" has a regular single seat mount selected in collections.
isRidingGroupMountis a bit poorly named. It actually should be called hasActiveGroupMount, because it just refers to what kind of mount you've equipped in collections, not whether or not you are mounted currently. That's what the first arg you're ignoring is for. This is how we do it in vanilla:

Code:
local mountedState, isRidingGroupMount = GetTargetMountedStateInfo(currentTargetCharacterNameRaw)
local isPassengerForTarget = IsGroupMountPassengerForTarget(currentTargetCharacterNameRaw)
local groupMountEnabled = (mountedState == MOUNTED_STATE_MOUNT_RIDER and isRidingGroupMount and (not IsMounted() or isPassengerForTarget))
  Reply With Quote
10/25/23, 02:05 PM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by ZOS_DanBatson View Post
isRidingGroupMountis a bit poorly named. It actually should be called hasActiveGroupMount, because it just refers to what kind of mount you've equipped in collections, not whether or not you are mounted currently. That's what the first arg you're ignoring is for. This is how we do it in vanilla:

Code:
local mountedState, isRidingGroupMount = GetTargetMountedStateInfo(currentTargetCharacterNameRaw)
local isPassengerForTarget = IsGroupMountPassengerForTarget(currentTargetCharacterNameRaw)
local groupMountEnabled = (mountedState == MOUNTED_STATE_MOUNT_RIDER and isRidingGroupMount and (not IsMounted() or isPassengerForTarget))
the issue is its returning true for "isRidingGroupMount" & "hasFree Passenger Slot" when they are standing on foot unmounted with only a group mount selected in collections... they both turn false when they select a single seat mount and are still unmounted. It previously did function correctly in the past. Sometime within the last 6mo it has changed.

Last edited by sinnereso : 10/26/23 at 06:57 AM.
  Reply With Quote
10/25/23, 02:19 PM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
If what your saying is true then "hasFreePassengerSlot" would always be true as they are not even mounted on it for someone to ever be sitting in it.
1st: It is true, and he even explained what the API function returns.
As I guessed before you need to take it in combination with the 1st parameter "isMounted" to find out what exactly is happening here, as the other 2 params only relate to the collections.

2nd: The 3rd param "hasFreePassengerSlot" should have these states, on the following dependencies:
Multirider mount selected in collections / Owner unmounted: true
Multirider mount selected in collections / Owner mounted: true if a slot is free, false if someone else is riding along as a passenger on this mount already
Multirider mount not selected in collections / Owner mounted or unmounted: false

At least that is what I'd assume.

And if this behavior changed in the past, which always is possible, then I guess Dan's answer is still valid and true: Current version returns what he described.

Last edited by Baertram : 10/25/23 at 02:21 PM.
  Reply With Quote
10/25/23, 02:42 PM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
To me it sounds as if it is working correctly and you are just misunderstanding what should be happening?

When the player has the mount equipped but is not mounted, it should return false, true, true, because they do indeed use a mount with more than one seat and the passenger slot is free.

Last edited by sirinsidiator : 10/25/23 at 02:49 PM.
  Reply With Quote
10/25/23, 03:10 PM   #6
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Yes I was just looking at all the possible combos as well and came to this conclusion that using all 3 params it is possible to determine if theyre mounted on multi rider and seat available.
  Reply With Quote

ESOUI » Developer Discussions » Bug Reports » [notabug]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