Compass Events
Is there such a thing as compass events?
I've been desperately attempting to figure out a way to access the compass pins (quests, POI, anything and all) when they appear on the compass but I can not find an event to even begin writing my AddOn. Currently, the only thing I want to do is when a Pin becomes visible on the Compass I want to grab what the pin is (pinType perhaps?) and write it (the name) to the chat panel. I thought this would be extremely simple being it would fire once (event?) but now several days in I'm just spinning in circles trying to put the puzzle together. Is there any documentation on COMPASS.container or ZO_WorldMap_IsPinGroupShown? Or better yet is there an event fired when a pin shows on the compass? |
Quote:
|
Would you be kind enough to show me in simple code sample?
Do I make an <OnUpdate> function and poll the GUI for what's actively displayed? |
Quote:
I was playing around with compass in my test addon Compass Distance (http://www.esoui.com/forums/showthread.php?p=9208). I don't know if it is the best way, but have hooked OnUpdate function: Lua Code:
Lua Code:
|
Quote:
and call that function via registration EVENT_MANAGER:RegisterForUpdate("OnUpdateSomethingYouMade", [number in miliseconds how often to call your function], [your function name]) |
Quote:
|
Quote:
|
Hopefully I'll figure this out and I appreciate the help.
My final goal, which is incredible simple (not for me apparently ~laughs~), is to output text to a message box <Label> that a "Quest Giver is near," thus why I am looking to find all compass pins then somehow distinguish between MAP_PIN_TYPE_QUEST_OFFER and all_the_rest. Again, thank you for a starting point and I hope I'll get it some day. =) |
Lua Code:
What does ZO_CompassContainer return? My error is something about userdata. |
Quote:
Fyrakin wrote that you have to check its children controls, it means something like: Lua Code:
|
Lua Code:
So happy! Got this outputting what I want to get started. Thank you a million times for getting me on track. I'll try to keep the amateur questions to a minimum now that I have one foothold on this mountain. ha! Edit: just wish there was a function to gather all marker pins on the compass rather than just the markers the avatar is directly facing; something like ZO_CompassContainer:GetAllPinInfo() |
Quote:
|
Quote:
What I truly need is a method to try all these functions and controls within an basic/universal example program. I'm extremely frustrated because I believe I'm looking at how everything works completely backwards. Looking at http://wiki.esoui.com/Userdata_in_100007_API I can't figure out what they return (or contain). Are these all objects? If so, how do I look at them? Every function I use on them returns nil or an error (userdata). Edit: How about that. Getting output now of ZO_MapPin1 through 50. Now to figure out how to map the globals to what they really are. |
Quote:
http://wiki.esoui.com/Controls Working code: Lua Code:
|
Quote:
|
Quote:
|
1 Attachment(s)
Attachment 373
I have to resign attempting to accomplish what I want to do. There is no way, I know of, to capture pins on the compass unless I directly "faced" the pin (and even then I have to run a pretty heavy polling function). The pin does exists on the compass before "facing" it (picture shows it off to the right side) but it's far beyond me how to iterate through all pins on the compass. I kept banging my head against this problem solely because the fact that "if it's displayed on my compass it must be somewhere in the GUI elements." Anyways, I started writing a new addon, successfully! (lol), that tracks player coordinates and displays a "Road Sign" (just a ToolTip, actually) on [s]keyPress[/s] slash_cmd when the user enters a polygon. I check all vertices and notifications are sent to the user there's a Road Sign ahead if they are within the polygons boundaries. I still need to make the slash_cmd hotKeyed for the ToolTip/Road Sign. I have feeling my road_sign_tbl is going to be gigantic. =) |
Quote:
In /zgoo "GetChild(index)" for ZO_CompassContainer says it's BLACKLISTED. Does that mean it's private? |
Quote:
if there are ZO_CompassContainer:GetNumChildren() > 0 then you can do the following: Code:
local numChildren = ZO_CompassContainer:GetNumChildren() |
Lua Code:
Result: Code:
The number of children: 67 |
I child control doesn't have global name, it can't be accessed from outside of the parent control.
Only pins that have defined global name are pins created by CustomCompassPins library - so you can work with pins added by your addons, but not with pins created by game itself. |
I keep getting more and more confused then; so this code does not work? It's been my foundation on attempting to get the pins/markers/anything off the compass.
Quote:
|
Quote:
|
Ok, so now I'm going way outside the box but perhaps there's a way to set the Visibility of MAP_PIN_TYPE_QUEST_OFFER to some odd alpha level (0.812) then use GetAlphaCoefficients? Wouldn't tell you the name of the NPC like GetCenterOveredPinInfo would (stringDesciption) but it would at least output something (user defined).
I have no idea what I'm talking about probably! =) |
Quote:
But as pins are created on compass, there should be way to get information about those pins at the time when they are created. I'd try to check if there is some event which can be used. I'm not in game right now, so I can't test it, but my guess is this event: EVENT_PLAYER_IN_PIN_AREA_CHANGED (*integer* _pinType_, *integer* _param1_, *integer* _param2_, *integer* _param3_, *bool* _playerIsInside_) |
Quote:
Edit: Unfortunately all my attempts would fail even if I could do what I wanted to, because COMPASS.container (ZO_Compasscontainer) keeps getting more elements as I move around (new markers are added) in the world but elements that are no longer visible on the compass remain. So, while I could collect information and assign it an ID within my own table I'll never be able to remove an element (again from my own table) because COMPASS.container never forgets an element it has seen. Terribly sorry if I'm explaining this wrong but a simple example is when I enter the world and run a script to GetNumChildren() from COMPASS.container it will show I have 67 children attached to that control (apparently I call them "elements" above ha!) and then move a few meters until a Quest Offer NPC shows on the COMPASS.container (doesn't matter where; can be on the left, right, or anywhere in between) the function call GetNumChildren() will now output 68. Victory! It does exist somewhere! ...but if I move back exactly (180 degree) the way I came until the markers fades (not visible anymore on the compass) GetNumChildren will still output 68. So as I was saying, if GetNumChildren() never decreases while moving through the world then, even if I could get the information I wanted, I would still need to know it no longer is available information. Thus the title of my thread "Compass Events" =) |
While I can't find anything new (or changed) that would help me produce the results I would desire are there any new functions, events, *anything* dealing with the Compass?
Tried to find GetAllVisibleCompassMarkersNoMatterWhichWayYouAreFacing() as a new function but no deal! ~laughs~ But seriously, though, anyone come across anything new? Edit: I do believe I'm at the point I am willing to pay(pal) someone for a solution. ~laughs~ ...no, really. I am. |
All times are GMT -6. The time now is 07:55 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI