Thread Tools Display Modes
01-01-08, 03:29 AM   #1
Niagairt
A Deviate Faerie Dragon
 
Niagairt's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 15
Outland Coordinates

How can I modify this code to give me coordinates in the Outlands (if its possible to get the X-Axis for flying mounts, that would be great)

Code:
local CoordText = "-> -> posX = "..math.floor(CurrentXCoord*1000).."     posY = "..math.floor(CurrentYCoord*1000).."  "..MinimapZoneText;
 
 RRT_defaultmsg(CoordText, 1.0, 1.0, 1.0);
 
 --DEFAULT_CHAT_FRAME:AddMessage(CoordText, 1.0, 1.0, 1.0);
Any help would be appreciated
  Reply With Quote
01-01-08, 03:35 AM   #2
Erurainon
A Chromatic Dragonspawn
 
Erurainon's Avatar
Join Date: Sep 2007
Posts: 158
I don't know the answer to your question; but.. you can get flying mounts in Shadowmoon Village and the coords for the village are 30,32..
  Reply With Quote
01-01-08, 04:09 AM   #3
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
I would have never had a problem displaying Outland coordinates. And on my flying mount (or in my case Flight Form) displaying XX,YY coordinates has never been an issue. Now if you are talking ZZ coordinates as well, then you are out of luck as the game engine currently does not have any support for Z coordinates.
__________________
Twitter
  Reply With Quote
01-01-08, 09:39 AM   #4
Niagairt
A Deviate Faerie Dragon
 
Niagairt's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 15
OK, I may not have been clear on what is outputted with this.......you don't get ZONE coordinates, but world Coordinates

IE. If you are standing in the middle of Three Corners in Redridge, the WORLD COORDINATES are 774,655 Move over to the Darkshire Graveyard and you are at 758,695.

As for now supporting the Z Coord in Outlands.....here is my argument about why it is.

When you are doing bombing runs in Skettis, the birds that attack you will move along the Z-Axis to attack you, therefore, Z-coords must be supported in the Outlands.

If it helps here is the ENTIRE section of code, instead of the few lines I needed Help with

Code:
function CurrCoords()
  local Continent,Zone=GetCurrentMapContinent(),GetCurrentMapZone();

  SetMapZoom(0);

  CurrRacerName = UnitName("player");
  local CurrentXCoord,CurrentYCoord=GetPlayerMapPosition("player");
  local MinimapZoneText = GetMinimapZoneText();
  
  local CoordText = "-> -> posX = "..math.floor(CurrentXCoord*1000).."     posY = "..math.floor(CurrentYCoord*1000).."  "..MinimapZoneText;
  RRT_defaultmsg(CoordText, 1.0, 1.0, 1.0);
  --DEFAULT_CHAT_FRAME:AddMessage(CoordText, 1.0, 1.0, 1.0);

  SetMapZoom(Continent,Zone);

end
Again, thank you for whatever help I can get
  Reply With Quote
01-01-08, 09:53 AM   #5
Malreth
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 9
Z coordinates are supported in the game engine everywhere, obviously, just by nature of being a 3D game. They are not, however, exposed to the UI so you can't get at them. We used to but a patch a long long long long long time ago removed access to it.
  Reply With Quote
01-01-08, 02:16 PM   #6
Niagairt
A Deviate Faerie Dragon
 
Niagairt's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 15
When I am in Azeroth I get the proper coordinates, when I go to the Outlands, I always get PosX=0 and PosY=0. what changed between the coordinate system in Azeroth and Outlands?
  Reply With Quote
01-01-08, 05:00 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Why do you want "world" coordinates, anyway? I see nothing on WoWWiki about "world" coordinates, and I've never heard of them before. Don't think they exist.

GetPlayerMapPosition() returns a unit's coordinates in a zone. Each zone has x,y coordinates that range from 0-100.

Nothing changed for Outlands. All coordinate mods still work in Outlands. Note that if you are in an instance, the game returns 0,0 as there are no coords in instances.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-01-08, 05:24 PM   #8
Kaomie
A Scalebane Royal Guard
 
Kaomie's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 438
Did you change the Zoom to "3" instead of "0" for Outland continent: SetMapZoom(3);
"0" is Azeroth so while in Outland your Azeroth coords would be erroneous.

@Seerah: those are continent coords, not zone. GetPlayerMapPosition is relative to whatever the map is currently showing.

EDIT: as far as altitude is concerned I do not know of a way to evaluate your position on the Z axis. Should not depend on being in Azeroth or Outland.
__________________
Kaomie
"WE LOTS OF PEOPLE FROM STRONG SERVER GUILDS" - Trade Channel

Last edited by Kaomie : 01-01-08 at 05:39 PM.
  Reply With Quote
01-01-08, 05:48 PM   #9
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Code:
SetMapZoom(0);
is your problem.
That line sets the map to showing Azeroth (both Kalimdor and Eastern Kingdoms)
It will obviously not work for Outlands.

The relevant index for Outlands would have to be
Code:
SetMapZoom(3);
Try something like this: (warning, drycoded)
Code:
function CurrCoords()
  if select(1,IsInInstance()) then return end --- we're in an instance return immediately

  local Continent,Zone=GetCurrentMapContinent(),GetCurrentMapZone();

  SetMapZoom(Continent);
--[[-- if for some reason you want to set the map to both continents or full Outlands
  if Continent <3 then
    SetMapZoom(0);
  else
    SetMapZoom(3);
  end 
  -- remove the block comment
]]
  CurrRacerName = UnitName("player");
  local CurrentXCoord,CurrentYCoord=GetPlayerMapPosition("player");
  local MinimapZoneText = GetMinimapZoneText();
  
  local CoordText = "-> -> posX = "..math.floor(CurrentXCoord*1000).."     posY = "..math.floor(CurrentYCoord*1000).."  "..MinimapZoneText;
  RRT_defaultmsg(CoordText, 1.0, 1.0, 1.0);
  --DEFAULT_CHAT_FRAME:AddMessage(CoordText, 1.0, 1.0, 1.0);

  SetMapZoom(Continent,Zone);

end
I'm guessing this is for the rat-race addon.
Describe exactly what you want to accomplish, as the above code will not give you 0,0 coords
but I'm not sure it will do what you want either

Describe your specifications and you'll get more meaningful feedback.

Edit: After I posted, I saw Kaomie posted the most relevant info while I was editing (wtb faster typing skills)

Last edited by Dridzt : 01-01-08 at 05:50 PM.
  Reply With Quote
01-02-08, 02:40 AM   #10
Niagairt
A Deviate Faerie Dragon
 
Niagairt's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 15
Yes it is for the Rat-Race addon, I want to modify it for outland races using flying mounts


Thank you for your help on that I appreciate all the help I can get as I am new to LUA
  Reply With Quote
01-02-08, 11:17 AM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Kaomie
@Seerah: those are continent coords, not zone. GetPlayerMapPosition is relative to whatever the map is currently showing.
Ah, so it is. I thought I was looking at the correct wowwiki page when I posted.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
01-28-08, 09:27 AM   #12
ProfOak
A Cyclonian
Join Date: Oct 2005
Posts: 47
Hi.

I'm having a bit of trouble understanding this replys tbh :/

For local zone coords I use:

SetMapToCurrentZone();
local px, py = GetPlayerMapPosition("player");

for print:
"Coords: "..(math.ceil(100 * px))..", "..(math.ceil(100 * py))


And world coords I use:

local px, py = GetPlayerMapPosition("player");
local cx, cy = GetCursorPosition();
local ceX, ceY = WorldMapFrame:GetCenter();
local wmfw, wmfh = WorldMapButton:GetWidth(), WorldMapButton:GetHeight();

cx = ( ( ( cx / WorldMapFrame:GetScale() ) - ( ceX - wmfw / 2 ) ) / wmfw + 22/10000 );
cy = ( ( ( ( ceY + wmfh / 2 ) - ( cy / WorldMapFrame:GetScale() ) ) / wmfh ) - 262/10000 );

if( cx < 0 ) then
cx = "0";
end;
if( cy < 0 ) then
cy = "0";
end;

for print:
math.ceil(100 * px)..", "..(math.ceil(100 * py)
math.ceil(100 * cx)..", "..(math.ceil(100 * cy)


So, by seing the post, makes me wonder if my way still works, cause if never had any prob that I know of or does the post show a more efecincy and/or better way to make this.

Cheers

P.S. This code is original from CT_Mod developers, credits goes to them. I just use it but take no credit for it.

Last edited by ProfOak : 01-28-08 at 10:36 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Outland Coordinates


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