Go to Page... |
Thread Tools | Display Modes |
04-22-08, 11:18 AM | #1 |
Relative position of raid members in a instance
Hello WoW UI experts,
Short question: Is there a way to get distances between raid members in a instance? Long question: I'm writing addon for priests that will suggest casting Circle of Healing to a raid member. Circle of Healing heals target and all its party members within 18 yards. So my addon should know distances between different members of raid. I can implement it if all raid members have addon that checks distances between "player" and "partyX" and sends it to other addons. But I don't want to force raid members to install my addon. Speculation: Minimap shows location of nearby raid members. Maybe there is a way to extract this information? Any suggestions and hints are appreciated. |
|
04-23-08, 06:19 AM | #2 | ||
It's a very, very, very restrictive way to know player's positions, because everyone has to use the addon, and you have to properly hook the pings so that they don't show if they are only meant to be a position update, and things like that. But it's still something doable to some extend. I started coding something for Kalecgos for my guild that pops a "Tomtom"-like arrow (hear "Crazy Taxi" if you don't know Tomtom), pointing to the portal, whenever a member of your "team" (which is defined in another guild-addon) gets a portal on himself. It uses this strategy, and it works decently on debug sessions when I test it with my own spells in Shattrah. As we downed Kalecgos in 1 try last week and it didn't work directly, I cannot really tell you that it works now, but it should. I hope it gives you an idea of what's possible to do. There may be other workarounds, but I doubt it. As you see, it's pretty hard to do anything that isn't completely shared among guild members, and even then, keeping updates very frequent would be a bad thing, I think. Edit:
|
|||
04-23-08, 07:00 AM | #3 |
You could have the cursor periodically moving over the minimap and parsing the tooltips.
|
|
04-23-08, 08:01 AM | #4 |
Layrajha,
If each member is required to use the addon (which breaks the usefulness of most mods imo), instead of using ping to define coordinates, why not just use a hidden channel to broadcast coordinates and parse that out instead? Since I imagine there are quite a few mod ideas that could make use of something like this, I iamgine this would be a great idea for a shared library. However, that said, it would be even better if GET_UNIT_COORD existed in the API |
|
04-23-08, 09:25 AM | #5 | |
P.S. What addon do you use on Kalecgos to form "teams"? I was going do write similar addon because people are always confused and don't know when they should jump in the portal. If it's your addon could you share it? P.P.S. It is possible to get distance from "player" to "partyX". Do you know if we can get direction as well? If we could then it's possible to calculate position of every raid member by doing triangulation (but it requires each raid member to broadcast distances to other members of the raid and directions to them). |
||
04-23-08, 09:26 AM | #6 |
Because in a instance you can't get coordinates even for "player".
|
|
04-23-08, 09:28 AM | #7 |
How can I do that? Is it possible to move cursor from addon code? Can you give me some pointers? And if my cursor is already above some raid member on minimap then how can I parse the tooltip that is popped up?
|
|
04-23-08, 09:38 AM | #8 |
Right - coordinates don't exist in an instance.
No, you'd have to move the minimap under your mouse periodically. This was an idea that was thought up to make a sound whenever an herb or ore popped up on the minimap - to make it really small and put it under your cursor. As for this type of idea... I don't know what you would gain from scanning the minimap in that fashion for raid members... |
|
04-24-08, 01:27 AM | #9 | |
|
||
04-24-08, 03:51 AM | #10 | ||
Anyway, about parsing tooltips, I don't know how people do it. You can probably hook all the gametooltip:set[something] methods ( http://www.wowwiki.com/Widget_API#GameTooltip ). If you need more about how the tooltips work, read things like http://wdnaddons.com/2418124/FrameXML/GameTooltip.xml and http://wdnaddons.com/2418124/FrameXML/GameTooltip.lua . Or if that's still too unclear, try to find an addon that parses tooltip data and looks simple to read (as in, you think that it probably parses tooltip data, and almost only does that ^^).
to the PS: It is a part of the same addon. Basically, the addon is a guild-compilation. The addon for the teams is not functional yet either. Or... partially, but full of bug. It's stupidly boring to test addons which require a full raid group, the ability to move members in the raid, with some addon communication involved etc :< to the PPS: You can get the exact distance (without pings, and in an instance)? How? If you can, I'm interested in that. If you meant that you can estimate the distance using "IsSpellInRange" and stuff like that, then the problem is that triangulation suffers too much from these variations. There are probably clever optimization algorithms that would gather all the distance data from everyone in the raid and compute the most probably map, but it'd be really expensive, CPU-wise, I believe. I am not very good in non-exact algorithmics, but I don't think it would be possible to do something like that which would be more or less precise, real-time, and lag-free. Unless, like, you use another comp with another (26th) player (not raiding), to which everybody sends data, and he does the maths and sends back the results every now and then, trading CPU for latency ^_^ |
|||
04-24-08, 11:04 AM | #11 | |
Thanks, Layrajha. I'll investigate what I can do with tooltips parsing.
But if it's possible to extract directions where other players located then we can do triangulation without distances at all. But I failed to find a way to get directions... |
||
04-25-08, 09:19 AM | #12 |
Well, it's indeed not possible to get the directions (unless you simply know where people are, as you can know where you're facing, but well, it doesn't really help ).
About the algorithm with imperfect data, yes, I think it's a very interesting problem as well. I guess that some "turbo" function, starting with the average possible distance for everyone (as in, you usually know they are like, "between 10 and 30 yards", and if so, just assume it's 20), slightly optimizing a cost value once, and doing it again and again until you have done a certain number of steps, or unless your cost function has reached a threshold. Finding a clever cost function is probably not too hard, coding the structure of the algorithm isn't either. But finding a way to actually give a consistent though not perfect "first draft" of a map with such imprecise data really looks hard. I'd probably try to place the players that are furthest away from each other... And anyway, whatever you do, you'll never have absolute positions: if you look your minimap in a mirror, the distances are the same. I mean that you cannot distinguish between mirror-equivalent maps unless you're given a hint by something that I haven't thought about. And after finding that, remains the coding part, the communication part between clients, etc Would really be a huge project, I think. |
|
WoWInterface » Developer Discussions » Lua/XML Help » Relative position of raid members in a instance |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|