Quantcast How to check if a mount is available at that location - ESOUI
Thread Tools Display Modes
01/22/20, 11:02 AM   #1
Calamath
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 4
How to check if a mount is available at that location

Is there a way to check if the player unit can ride a mount animal in the place beforehand with API?

being able to create an add-on indicator that shows where you can't ride a mount.

I am working on the code to determine if the player unit is inside a building, but such an API would be very helpful.
  Reply With Quote
01/22/20, 03:33 PM   #2
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 108
Not sure, but I've had some dealings with mounts before in my ShowMount addon, so maybe anything in it could help. I'm also seeing at a glance the command HasMountedFailure(), not sure what it's for. Good luck.
__________________

Author of beloved and rejuvenated addons:

ShowMount             PvP FPS 2018

Notebook 2018         Junkee 2018

BestFriends 2018       New Addon
  Reply With Quote
01/22/20, 03:45 PM   #3
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 586
As far as I know, there isn't a function to check on the fly whether you can mount somewhere without attempting to mount first. Maybe someone knows an obscure way to do it.
  Reply With Quote
01/22/20, 04:01 PM   #4
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,646
As mounts are collectibles you could detect a standard collectible ID for a mount and try to use it with the collectible api functions. I think there was something like IsCollectibleUsable or similar. But not all users got all mounts so you'd need to detect at least one mount a user owns first somehow. And: if the function was successful the next mount attempt will use this mount ID then...
  Reply With Quote
01/23/20, 10:14 PM   #5
Calamath
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 4
Thanks for your comments. After some consideration and verification, I came to the conclusion there seems to be no solution at this time, unfortunately.

I tried various approaches using several 'collectible API'. We have IsCollectibleUsable() and UsCollectibleBlocked() for example. But these are for determine if your favorite mount can be activated. In other words, it is currently possible to select your favorite mount even in a building, and these API always return true in that case. That's a bit disappointing for me.
  Reply With Quote
01/24/20, 03:31 AM   #6
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,646
Oh right, did not think about this.

What about this event?
Code:
EVENT_MOUNT_FAILURE (number eventCode, MountFailureReason reason, number arg1)
Maybe it triggers if you cannot mount and the MountFailureReason provides infos then?
-> MOUNT_FAILURE_REASON_INVALID_LOCATION

Edit:
After rethinking this you'd need a function which actually tries to mount, and this is private if I rememmber correctly :-(
  Reply With Quote
01/24/20, 04:38 AM   #7
Calamath
AddOn Author - Click to view addons
Join Date: Aug 2019
Posts: 4
Yes, there is a way to track the results after riding, but I want to know in advance.
ToggleMount () is a private API. Therefore, I think it seems unlikely that the smart API guys will provide a new API like CanUnitRideMount() they probably use inside.
  Reply With Quote
01/24/20, 06:05 AM   #8
Baertram
 
Baertram's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 2,646
In the past there exist an ZOs tolerated additional client for ESO where you could run private functions like normal functions.
Not sure if it sill exists, I think last time I checked the download link was broken and there was no official page anymore. They renamed it as well in the past years.

I once coded an addon for this called "FCO Mounter". But I don#t think many users will use this client (if it still works) as ZOs never really said it is allowed "in total" and "fully compatible with their TOS".
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » How to check if a mount is available at that location

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