04/25/14, 10:52 AM | #1 | |
Join Date: Apr 2014
Posts: 5
|
Map Pins
Hello everybody, I really want to make my first little AddOn, wich will just show Trunks and Nightshades on Map, I just need a mod.lua(logic) and modData.lua (contain array with coordinates and icon), mod.txt(manifest), and icons folder.
Can you help me? I read Tutorial on Wiki, but I can't understand how Pins(CustomCompassPins) library works. I never before work with Lua, but I work with many script languages =) AddOn name: SKVTrunkMap SKVTrunkMap.txt Code:
## Title: SKV1991 Addon ## Version: 0.0.1 ## Author: |ca200ffskv1991|r ## APIVersion: 100003 ## SavedVariables: SKVTM_SavedVariables ## OptionalDependsOn: CustomCompassPins Libs/CustomCompassPins/CustomCompassPins.lua SKVTrunkMap.lua SKVTrunkMap.xml Code:
------------------------------------------------------------------------------- -- SKVTrunkMap v0.0.1 ------------------------------------------------------------------------------- if SKVTM == nil then SKVTM = {} end function OnLoad() CHAT_SYSTEM:AddMessage("AddOn started") end -- slash commands SLASH_COMMANDS["/skvtm"] = OnLoad EVENT_MANAGER:RegisterForEvent("SKVTrunkMap_OnLoad", EVENT_ADD_ON_LOADED, OnLoad) Icons Skvtrunk.dds Can you explain, how to work with CustomCompassPins and how to add my icons to map? I don't want to make it like SkyShards map, only icon(s) at specific coordinates. Help newbie become modder please! |
|
04/25/14, 03:27 PM | #2 |
|
that library creates compass pins, not mappins.
this post might help you: http://www.esoui.com/forums/showpost...10&postcount=2 |
04/25/14, 04:08 PM | #3 | |
Lua Code:
2) CustomCompassPins library does not add map pins to the WorldMap, it shows markers on compass. If you want to add pins to the WorldMap, you should use: Lua Code:
where: pinType = unique string that defines category of your pins pinTypeAddCallback = function(pinManager) that is called every time when map is changed and should create pins for given area. Example function (CreateMapPins): Lua Code:
pinTypeOnResizeCallback = function(pinManager, mapWidth, mapHeight), called every time when map is resized (zoom). Usualy not defined (nil). pinLayoutData = table that contains: Lua Code:
pinTooltipCreator is a table that contains function that creates tooltip and type of tooltip you want to use. Lua Code:
Last edited by Garkin : 05/16/14 at 08:03 AM. Reason: Removed icon:SetDesaturation() as it was not good example - you have to hook function in order to reset it back. |
||
04/26/14, 03:43 AM | #4 | |
Join Date: Apr 2014
Posts: 5
|
Guys, thank you so much for information! I will use it!
But why I can't see a text in chat, while AddOn is loaded? txt Code:
## Title: |cFFFFB0SKVTrunkMap|r 0.0.1 - By |ca200ffSKV1991|r ## Version: 0.0.1 ## Author: skv1991 ## APIVersion: 100003 ## SavedVariables: SKVTM_SavedVariables Libs/CustomCompassPins/CustomCompassPins.lua SKVTrunkMap.lua Lua Code:
In AddOn's menu my mod is active, where I do something wrong? Haha, thats easy but I can't get that But if I put message in local function and call it using SLASH_COMMANDS, iI recieve message properly, whats wrong with Events? Here another example Lua Code:
When I type /skvdo, I recieve these errors: Last edited by skv1991 : 04/26/14 at 04:16 AM. |
|
04/26/14, 04:10 AM | #5 | |
|
This event is fired after every loading screen, so you may want to call EVENT_MANAGER:UnregisterForEvent("addonname", EVENT_PLAYER_ACTIVATED) in that callback function. Code:
ZO_WorldMap_AddCustomPin(pinType, pinTypeAddCallback, nil, pinLayoutData, pinTooltipCreator) Last edited by Shinni : 04/26/14 at 04:22 AM. |
|
04/26/14, 04:28 AM | #6 | |
Join Date: Apr 2014
Posts: 5
|
Yeah, thats working! But map icon looks like white square
mistake in lua Code:
Now I need to add more funcionality and, maybe, compass data =) BIG thanks guys, I will write code here, when I'm done =) Last edited by skv1991 : 04/26/14 at 05:19 AM. |
|
ESOUI » Developer Discussions » General Authoring Discussion » Map Pins |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|