Thread Tools Display Modes
10-25-16, 02:34 PM   #1
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
GetPlayerMapPosition - 7.1

This now seems to return zero after performing a ReloadUI requiring a complete logout or exit to restore.

Edit: it now returns to producing coordinates after exiting an instance or crossing a zone boundry but still zeros moving in your current non-instanced zone after a ReloadUI.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-25-16 at 05:45 PM.
 
10-25-16, 04:28 PM   #2
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Just to make sure; you're aware of the changes to this function?
__________________
Grab your sword and fight the Horde!
 
10-25-16, 04:33 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Indeed, I ReloadUI and get zeros and nil/zeros going into/out of instances.

Logout/on and it's coordinates and nil/coordinates going into/out of instances.

Edit: It's now ReloadUI and get zeros and nil/coordinates going into/out of instances, not sure if there was a hotfix since the last time I tried it.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-25-16 at 04:37 PM.
 
10-25-16, 04:52 PM   #4
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Well, you aren't supposed to get coords while in instance, so it works as intended... o_O
__________________
 
10-25-16, 05:01 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
I get zeros after ReloadUI while not in an instance. The instance in/out part seems to be working now where originally I was still getting zeros after exiting an instance.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
 
10-25-16, 07:44 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
What happens if you run SetMapToCurrentZone()? If it's somehow loading up the map for an area you're not in, it's not going to give you your coordinates on it.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-25-16 at 07:46 PM.
 
10-25-16, 10:09 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Originally Posted by SDPhantom View Post
What happens if you run SetMapToCurrentZone()? If it's somehow loading up the map for an area you're not in, it's not going to give you your coordinates on it.
I didn't think of that, it hadn't been required pre 7.1. I'll give it a go, thank you.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-25-16 at 10:16 PM.
 
10-25-16, 10:16 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
I was was running SetMapToCurrentZone() on ZONE_CHANGED_NEW_AREA. I added PLAYER_ENTERING_WORLD and that fixed it. Thank you.

Edit for typo in the event name not causing it to trigger. Did ZONE_CHANGED_NEW_AREA used to happen when logging on?
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-25-16 at 10:24 PM.
 
10-25-16, 11:16 PM   #9
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Further testing on a rogue order hall with ZONE_CHANGED_NEW_AREA or PLAYER_ENTERING_WORLD registered and both calling SetMapToCurrentZone() when fired.

Glorious Goods entrance:
Niether event is fired entering or exiting the order hall. GetPlayerMapPosition("player") returns zeros when entering and coordinates when leaving.
EDIT: GetPlayerMapPosition("player") appears to be switching states. ie. if it's displaying zeros before entering it will show coordinates inside. if it's displaying coordinates before entering it will show zeros inside.

One More Glass entrance:
On entering, neither event is fired and GetPlayerMapPosition("player") returns zeros on entering (expected). On exiting, PLAYER_ENTERING_WORLD is fired which calls SetMapToCurrentZone() but GetPlayerMapPosition("player") still returns zeros.

Going to from my mage order hall gets both events entering and exiting and gets coordinates inside the order hall (I didn't expect that).
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-25-16 at 11:40 PM.
 
10-26-16, 08:44 AM   #10
ceylina
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Just to make sure that you are only using SetMapToCurrentZone() by checking if WorldMapFrame:IsVisible() is false right? Otherwise you will do all sorts of nasty things when a user opens their world map (like reset to current zone if they select a new zone with the map open and your addon triggering)
 
10-26-16, 10:36 AM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
That's the general consensus of how it's used, though there is another method I developed years ago. It would let you get data in the zone the user is in while the WorldMapFrame is up and they would never know.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
 
10-26-16, 11:47 AM   #12
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Testing on a rogue with one addon consisting of the following
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:SetSize(10, 10)
  3. f:SetPoint("TOP", 0, -20)
  4. f.t = f:CreateFontString()
  5. f.t:SetPoint("CENTER")
  6. f.t:SetFontObject("GameFontNormal")
  7. f:SetScript("OnUpdate", function(self)
  8.         local x,y = GetPlayerMapPosition("player")
  9.         if x then
  10.             local x = format("%.1f", x*100)
  11.             local y = format("%.1f", y*100)
  12.             self.t:SetText(x .. " " .. y)
  13.         else
  14.             sellf.t:SetText("")
  15.         end
  16.     end)

Logon displays coordinates.
Enter the order hall via Glorious Goods displays zeros.
Exit the hall displays coordinates.

Enter the hall again - zeros.
/reload - zeros

Logoff/on inside the hall you now have coordinates.
Exit the hall - zeros
Exit Glorous Goods - coordinates.

Regardless of SetMapToCurrentZone(), GetPlayerMapPosition() is getting zone information and in some cases toggling how it functions. Whether this is just the rogue hall, certain order halls or certain types of instances I don't know.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-26-16 at 11:50 AM.
 
10-26-16, 12:02 PM   #13
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Same test at the One More Glass entrance, same result with the exception that you don't get coordinates back when you exit but will once you cross the zone boundry by taking a taxi.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
 
10-29-16, 02:57 AM   #14
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
Ended up making a rogue using class trial, but I found a solution to the problem. Apparently ZONE_CHANGED_INDOORS is firing at the right time to call SetMapToCurrentZone() from in addition to PLAYER_LOGIN and ZONE_CHANGED_NEW_AREA.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-29-16 at 04:11 AM.
 
10-29-16, 10:05 AM   #15
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
ZONE_CHANGED_INDOORS, I hadn't thought of that, thank you. I found opening closing the map reset it without the logout/login.

Now there seems to be a coordinate "dead" zone over the sea around Dalaran when taking a taxi. Most noticable between Dal. and Stormheim. It seems to be being triggered as a dungeon rather than just inside. Not earth shattering but maybe not the only one.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
 
10-29-16, 12:22 PM   #16
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
There are spots in the game where no zone maps cover. These are commonly around the edges of a continent. I don't think SetMapToCurrentZone() ever chooses a continental map anymore, just whatever zone you're closest to or are currently in.

But ya, class halls appear to be scenarios internally, much like Garrisons were in WoD.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-29-16 at 12:30 PM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » GetPlayerMapPosition - 7.1

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