Nearest Wayshrine to Player
Hello All,
I was looking for some guidance on where to start for creating an AddOn with a UI that displays the closest Wayshrine to a player's position. I need to: Determine Player PosX, PosY Find All Wayshrine Locations Calculate the closest wayshine from the players location Output that information to a UIWhere can I pull player position? Where can I get a list of wayshrines and their locations? P.S: I tried looking at the "FasterTravel" AddOn which determines the closest wayshrine to your quest but it was too advanced for me to figure out exactly what the functions they created were doing. Thank you. |
There is no api to detect that, you are not the first to try this.
You'd need to manually collect all washrine positions in a table of your addon, and update it every patch. I hope you got time?;) |
It has been done in the AddOn FasterTravel by manually adding each entry, I can copy their table I suppose. I don't know how they have determined which one is closest though.
They found the closest Wayshrine to your quest, I just need to change it to Closest to player. |
Are you going to be detecting the closest player to you in your group? Because you can't get other players positions that aren't in your group.
|
Quote:
in function Lua Code:
Lua Code:
Lua Code:
distance from each wayshrine is calculated with Lua Code:
|
oh btw, player position:
Lua Code:
Maybe some libs can help here too, check the Lib descriptions for the ones relating to maps, positions, etc. and also to calculate between normalized and actual positions (not sure which lib was supporting this, maybe LibMapPin or LibGPS?). |
All times are GMT -6. The time now is 05:04 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI