Thread Tools Display Modes
09-16-13, 05:28 AM   #1
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Help with vignette API

So 5.4 added icons for rare creatures and chests in Pandaria to the minimap. You can register when they appear with the VIGNETTE_ADDED event. This event passes on instanceID as one of the arguments. You can also find this ID through C_Vignettes.GetVignetteInstanceID(i) where i is a number from 1 to C_Vignettes.GetNumVignettes().

The problem is with C_Vignettes.GetVignetteInfoFromInstanceID(vignetteInstanceID). This should pass on x and y coordinates as well as the name, which is what I'm mostly interested in. However, so far, it only appears to work for chests (such as "Kukuru's Treasure Cache") and not for actual creatures.

Is there anyone that has also been trying to work with this API and found some more info on this?
  Reply With Quote
09-16-13, 06:45 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Google says this:
http://us.battle.net/wow/en/forum/topic/9972357544

C_Vignettes.GetVignetteInfoFromInstanceID will sometimes not return data for instanceids provided by vignette events or other C_Vignettes functions.

When it breaks, it seems to be more likely to happen with negative instanceids and very high instanceids, though this is slightly speculation from observed differences between when it is working and when it is not.

Basically, addons are unable to pull vignette information when VIGNETTE_ADDED fires because the insctaneid doesn't work with the C_Vignettes.GetVignetteInfoFromInstanceID function. Often times instead it returns nil or even an "integer overflow" error.
Does this reflect your problem?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-16-13, 06:57 AM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Huh, interesting. It just seemed unusual, perhaps even intentional, that it only works on chests but never on NPCs (from my experience).
  Reply With Quote
09-16-13, 09:33 AM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Hmm I even found an IRC chat from semlar with kraymor (or sth the like). They talked about the possibilities to convert the coordinates into worldmap coordinates.

Afaik x,y are just positions of the texture on the minimap in relative position to the bottomleft corner of the minimap texture.

http://purl.rikers.org/%23wowuidev/20130824.html.gz
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-16-13, 02:07 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Long story short, while I was able to write an addon that tracked the vignette coordinates on my client, the conversion changes based on your ui scale, resolution and possibly the aspect ratio or other factors.

We probably would have figured it out after a while, but we gave up once we realized the api stops returning anything for new vignettes after the server has been up for a while. It would seem that after a certain number have been created, it just stops returning information for new ones.

I haven't seen it fail to return information for a treasure chest yet though, only rares and rare events.

I've speculated that the instance ID can't be represented by an integer and when it fails to return any information it's because the ID it's giving you isn't actually correct, but I'm not sure if there's anything that can be done about it.

Last edited by semlar : 09-16-13 at 02:21 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with vignette API


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