Thread Tools Display Modes
06/08/15, 11:05 AM   #1
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Irregular shaped pin zone - possible?

I am trying to create zone pins for AvA, but am limited to pins with radius, overlapping to make the correct shape (as far as I know, it is not possible to make zone markers with irregular shapes).

I use:
lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)

My questions are the following:
Is it possible at all to create irregular shaped pin zones instead of overlapping circles?
If not, is it possible to change the COLOR (tint) of the area shown on my test?

Currently my test looks like this:

but I would like something like this:
  Reply With Quote
06/09/15, 02:41 AM   #2
XanDDemoX
AddOn Author - Click to view addons
Join Date: May 2015
Posts: 28
You could store the shape's data in the pinTag. Not sure how you'd draw it though

Edit: Have a look at "ZO_KeepNetwork" in ingame/worldmap.lua (3180) that might help with drawing lines
Edit2: LineControls are probably also worth a look

Example lines of a rectangle:

Code:
local pinTag = {

    points = {
           
           -- top
           {x=0.25,y=0.25},
           {x=0.75,y=0.25},

           -- left
           {x=0.25,y=0.25},
           {x=0.25,y=0.75},

           -- bottom
           {x=0.25,y=0.75},
           {x=0.75,y=0.75},

           -- right
           {x=0.75,y=0.25},
           {x=0.75,y=0.75}
  
    }

}


local pin = lib:CreatePin(pinType, pinTag, locX, locY, areaRadius)

Last edited by XanDDemoX : 06/09/15 at 03:46 AM.
  Reply With Quote
06/09/15, 06:25 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,586
I don't think there is a way to do this with API functions.

The map pins are using textures, so you could create the necessary shapes as textures and place them as pins. Although they mentioned that the current pin system does only allow for a limited number of pins in one of the ESO Live episodes, so I am not sure if this is your best option.

As already mentioned by XanDDemoX you could also draw an outline with the line controls, but I think that would produce a lot of memory overhead because you will need thousands of them and you can't fill an area with them (they are basically just showing a texture).

I think a good way might be to create custom map tiles in a graphics program and then hook into the GetMapTileTexture function to add the visuals and handle the mouse over effect separately.
You might want to take a look at the ZO_MouseoverMapBlobManager to see how the highlighting of subzones works and do something similar. Of course you will need a function like GetMapMouseoverInfo to return which zone the mouse is currently over. You could port this algorithm for doing a hit test with your custom zones and then return the appropriate info.
  Reply With Quote
06/09/15, 08:57 AM   #4
XanDDemoX
AddOn Author - Click to view addons
Join Date: May 2015
Posts: 28
Originally Posted by sirinsidiator View Post
I don't think there is a way to do this with API functions.

The map pins are using textures, so you could create the necessary shapes as textures and place them as pins. Although they mentioned that the current pin system does only allow for a limited number of pins in one of the ESO Live episodes, so I am not sure if this is your best option.

As already mentioned by XanDDemoX you could also draw an outline with the line controls, but I think that would produce a lot of memory overhead because you will need thousands of them and you can't fill an area with them (they are basically just showing a texture).

I think a good way might be to create custom map tiles in a graphics program and then hook into the GetMapTileTexture function to add the visuals and handle the mouse over effect separately.
You might want to take a look at the ZO_MouseoverMapBlobManager to see how the highlighting of subzones works and do something similar. Of course you will need a function like GetMapMouseoverInfo to return which zone the mouse is currently over. You could port this algorithm for doing a hit test with your custom zones and then return the appropriate info.
Definitely agree on the potential for memory overhead sirinsidiator Even treating each line control as a scan line would still potentially need lots of line controls .

Been doing a little testing and found some (possibly) useful functions on TextureControl that may be what SnowmanDK is looking for .

Code:
-- ensure worldmap is open (any TextureControl should do really)
local c = ZO_QuestPinBlob1

-- colour/tint the texture (r,g,b,a 0-1)

c:SetColor(1,1,1,1)

-- alters vertex tint (vertex,r,g,b,a 0-1) 

c:SetVertexColors(1,1,0,0,1)

-- alters vertex texture UV coordinates (vertex,x,y)

c:SetVertexUV(1,0.3,0)


More about vertex UV coordinates:
http://www.graphics.cornell.edu/onli...ks/vrtxUV.html
http://answers.unity3d.com/questions...-uvs-work.html
https://www.google.com/search?q=vertex+uv+coordinates

Last edited by XanDDemoX : 06/09/15 at 09:04 AM.
  Reply With Quote
06/09/15, 10:00 AM   #5
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
Thanks for your replies so far, but I realized I forgot to mention one important detail.
You HAVE to be able to see on the radar when you are inside the zones, with the correct color.
Say, I want Keep defence zones red, and resource zones blue, then the radar should turn redish when inside the keep defence zone, blue within a resource defence zone, and return to normal anywhere else.
Map isn't as important as the radar, so I could essentially skip zones on the map as long as they are shown on radar...
I am working on this as a means to see if you are inside the bonus alliance points areas.
Sorry about this missing information.
  Reply With Quote
06/09/15, 10:55 AM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,586
Maybe you can trigger that behavior manually by calling
Lua Code:
  1. COMPASS:PlayAreaPinOutAnimation(journalIndex, stepIndex, conditionIndex)
  2. COMPASS:StopAreaPinOutAnimation(journalIndex, stepIndex, conditionIndex)

Those get called when the EVENT_PLAYER_IN_PIN_AREA_CHANGED fires and I think they are also used for custom pins. So maybe take a look at the parameters for that event when you enter a custom pin and mimic that?
  Reply With Quote
06/09/15, 11:32 AM   #7
XanDDemoX
AddOn Author - Click to view addons
Join Date: May 2015
Posts: 28
Originally Posted by SnowmanDK View Post
Thanks for your replies so far, but I realized I forgot to mention one important detail.
You HAVE to be able to see on the radar when you are inside the zones, with the correct color.
Say, I want Keep defence zones red, and resource zones blue, then the radar should turn redish when inside the keep defence zone, blue within a resource defence zone, and return to normal anywhere else.
Map isn't as important as the radar, so I could essentially skip zones on the map as long as they are shown on radar...
I am working on this as a means to see if you are inside the bonus alliance points areas.
Sorry about this missing information.
These collision detection links might be helpful

http://noonat.github.io/intersect/

http://twistedoakstudios.com/blog/Po...nd-differences

http://www.wildbunny.co.uk/blog/2011...n-for-dummies/

http://gamedev.stackexchange.com/que...ich-sides-that
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Irregular shaped pin zone - possible?


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