Thread Tools Display Modes
02-05-08, 03:50 AM   #1
phelaan
A Murloc Raider
Join Date: Jan 2008
Posts: 5
Question Is there a way to get a different player's position?

Im currently working on an addon to show other players direction and distance, but im having trouble finding a good way to get a precise location (continent, map, x, y) of players in my party/raid if they're not in the same zone as i.

I've gotten so far that i found that i can use the distance-routine in Astrolabe, but that requires the above mentioned infos' for the person i wanna "track".

I can get the information for myself ("player") by using these API calls:
Code:
local continent = GetCurrentMapContinent();
local map = GetCurrentMapZone();
local x, y = GetPlayerMapPosition("player");
So, my question is: How do i get the same information for ie. my target (if my target is in my group/raid?)

Hope to get some tips/feedback on this... thanks in advance
  Reply With Quote
02-05-08, 05:21 AM   #2
Voonka
A Cyclonian
Join Date: Mar 2006
Posts: 47
Not sure what code to use exactly, but you might take a look at the guild map plugin for cartographer. I'm sure it uses similar routines since it can pinpoint on the map guildies' zones, and coords. I'd imagine looking at the code for it would be helpful. Hope that is at least a point in the right direction
__________________
  Reply With Quote
02-05-08, 05:59 AM   #3
phelaan
A Murloc Raider
Join Date: Jan 2008
Posts: 5
Thx Voonka, i'll do that. Actully i had it loaded in an editor to try to peek into some of the code, as i did recall that i shows the small icons on the maps over guildies.

I'll post more info here when i find a solution. Right now im at work, and better focus on that hehe.

I bet there must be some way to get it by looking how the guild-tab shows which zone people are in also... hmm
  Reply With Quote
02-05-08, 09:23 AM   #4
phelaan
A Murloc Raider
Join Date: Jan 2008
Posts: 5
Originally Posted by Voonka
guild map plugin for cartographer. I'm sure it uses similar routines since it can pinpoint on the map guildies' zones, and coords
It appears that Cartographer uses addon-addon communication to show guildies positions. That explains why i've sometimes experienced that i can see where some people in my guild are, and some i can't see.

I wonder if there's another way around though... i sure hope so.
  Reply With Quote
02-05-08, 10:38 AM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It uses the addon communication channel so that it can get their locations when they are not in your group. The default UI shows you on your map where your party and raid members are, though I'm not sure of a function to get that data.
__________________
"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
03-25-08, 07:21 AM   #6
fisknils
A Kobold Labourer
Join Date: Mar 2008
Posts: 1
I'm too lazy to read all the replies to this post, so if you've solved the problem, then just ignore me.

The code to get your target player name (which I assume is the problem) is:
Code:
UnitName("Target");
So I guess you could just do...
Code:
posX, posY = GetPlayerMapPosition(UnitName("Target"));
To solve your problem.

Last edited by fisknils : 03-25-08 at 07:23 AM.
  Reply With Quote
03-25-08, 09:26 AM   #7
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
GetPlayerMapPosition works directly with the unitid .. not with the name.. so this won't work.

The function also don't accept all unitid's to prevent botting... "player", "partyX" and "raidX" should work. pet's won't work and I don't think "target" works.

see: http://www.wowwiki.com/API_GetPlayerMapPosition

Last edited by dafire : 03-25-08 at 09:31 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Is there a way to get a different player's position?


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