Thread Tools Display Modes
02/22/14, 01:14 AM   #1
Capadillo
Join Date: Feb 2014
Posts: 12
Post Creating AddOns w/o BETA Access

I am looking at creating a UnitFrame addon for ESO when it comes out, and I would like some assistance from programmers (either in, or out of PTS testing) to make sure I am close to the mark.

Lua Code:
  1. local assocFrame = {
  2.     "player" = {
  3.         POWERTYPE_HEALTH  = "playerHealthBar",
  4.         POWERTYPE_MAGICKA = "playerMagickaBar",
  5.         POWERTYPE_STAMINA = "playerStaminaBar",
  6.     },
  7.     "target" = {
  8.         POWERTYPE_HEALTH  = "targetHealthBar",
  9.         POWERTYPE_MAGICKA = "targetMagickaBar",
  10.         POWERTYPE_STAMINA = "targetStaminaBar",
  11.     },
  12. }
  13.  
  14. local barWidth, barHeight = 200, 20
  15.  
  16. local function eventUpdatePower(unit, powerType, powerCurrent, powerMax)
  17.     local statusBar = assocFrame[unit][powerType]
  18.     if not powerCurrent or not powerMax then
  19.         powerCurrent, powerMax = GetUnitPower(unit, powerType)
  20.     end
  21.     statusBar:SetDimensions(( powerCurrent / powerMax ) * barWidth, barHeight)
  22. end

I am reading through some existing addons, but actually getting info straight from you guys would be much better.

EDIT: I am assuming that "EVENT_POWER_UPDATE" will return all of the information for updating the individual powers as well, so we would only need to use "GetUnitPower" to force an update, or during login?

EDIT2: Updated the code...

EDIT3: Thank you for moving. I completely missed the dev forums. :3

Last edited by Capadillo : 02/22/14 at 06:54 AM.
  Reply With Quote
02/22/14, 10:53 PM   #2
Lyeos
 
Lyeos's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 6
Originally Posted by Capadillo View Post
EDIT: I am assuming that "EVENT_POWER_UPDATE" will return all of the information for updating the individual powers as well, so we would only need to use "GetUnitPower" to force an update, or during login?
Yes, exactly

First you have your event:
EVENT_POWER_UPDATE (string unitTag, luaindex powerIndex, integer powerType, integer powerValue, integer powerMax, integer powerEffectiveMax)

You have to register it before using it like this:
Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("YOUR_ADDON_NAME", EVENT_POWER_UPDATE, eventUpdatePower)
You can see a line like this at the beginning of almost every addon.

Then your first function will be:
Lua Code:
  1. local function eventUpdatePower(eventCode, unit, powerIndex, powerType, powerCurrent, powerMax)
  2. ...

For what remains I think you are pretty much right.
You need more things (Controls, Anchor, etc...) but you are in the good way

Last edited by Lyeos : 02/22/14 at 10:57 PM.
  Reply With Quote
02/22/14, 11:36 PM   #3
Capadillo
Join Date: Feb 2014
Posts: 12
Thanks for some of the clarification! I can't wait to get my hands on the rest of the API, and be able to test it live!

Just a couple of quick follow-ups; The event variables seem to return more then the addon I was reading seem to indicate: unitTag, powerType, powerValue, powerMax. From your post there is another 2 returned? Also, what does powerEffectiveMax return? Does it account for reduced max health from a debuff?

Again, thank you for your reply!

Last edited by Capadillo : 02/22/14 at 11:51 PM.
  Reply With Quote
02/22/14, 11:43 PM   #4
ESOljl
 
ESOljl's Avatar
Join Date: Feb 2014
Posts: 14
I believe the api has been released, according to this thread http://www.esoui.com/forums/showthread.php?t=80
  Reply With Quote
02/22/14, 11:48 PM   #5
Capadillo
Join Date: Feb 2014
Posts: 12
Originally Posted by ESOljl View Post
I believe the api has been released, according to this thread http://www.esoui.com/forums/showthread.php?t=80
You're not wrong, and thanks for the link!

Though there is still little we can practically do from just knowing the names.
  Reply With Quote
02/23/14, 05:01 AM   #6
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Yeah, I've gone through most of the addons and extracted the function variables that I could see in preparation but until we get to log in again it's just a waiting game.
  Reply With Quote
02/23/14, 02:18 PM   #7
JonathanDark
 
JonathanDark's Avatar
Join Date: Feb 2014
Posts: 6
Originally Posted by Xrystal View Post
Yeah, I've gone through most of the addons and extracted the function variables that I could see in preparation but until we get to log in again it's just a waiting game.
That's actually a good idea. I may try to take some time to pick apart Wykkyd's add-ons and fill in the gaps based on the APIs he's used so far. Hopefully, he won't mind me reverse-engineering his stuff.
  Reply With Quote
02/23/14, 10:20 PM   #8
Capadillo
Join Date: Feb 2014
Posts: 12
Originally Posted by JonathanDark View Post
That's actually a good idea. I may try to take some time to pick apart Wykkyd's add-ons and fill in the gaps based on the APIs he's used so far. Hopefully, he won't mind me reverse-engineering his stuff.
If it's to further everyones understanding, I'm sure he'll be fine with it! :P

A lot of us will have some catching up to do in the next few months.
  Reply With Quote
02/24/14, 03:00 PM   #9
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Yeah once I see the functions/events in action I'll feel more comfortable updating the wiki. Hopefully this weekend .. with only 5 weekends left I'm hoping every weekend now will be a beta weekend.
  Reply With Quote
02/27/14, 11:21 AM   #10
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by JonathanDark View Post
That's actually a good idea. I may try to take some time to pick apart Wykkyd's add-ons and fill in the gaps based on the APIs he's used so far. Hopefully, he won't mind me reverse-engineering his stuff.
Have at it.

While you're in there, I'm open to tips tricks and advice, heh. I'm just one guy coding on a lot of fronts, and working a day job 8 to 16 hours a day doing C# and SQL. I don't spend a lot of time psychoanalyzing my code in Lua. I get it working and move on to the next bullet point/objective.

That said I've had Psijic/PTS access since October, as have several others. So my addons are a result of a lot of trial and error, a lot of use of things like ZGOO to find undocumented features and a lot of painstaking iterate-save-test-redo to get things to do what they should be doing.

I do still have a million planned features and thus am far from done. Also, Wykkyd's Framework is getting better almost daily with cleaner, nicer and newer features for other addon devs to use to speed up their development. After this weekend it should be even better. So at the very least you could leverage it to help speed yourself up... though I've yet to have time to write the "Usage Doc" I plan to write before launch for it
  Reply With Quote
02/27/14, 02:17 PM   #11
JonathanDark
 
JonathanDark's Avatar
Join Date: Feb 2014
Posts: 6
Originally Posted by Wykkyd View Post
That said I've had Psijic/PTS access since October, as have several others. So my addons are a result of a lot of trial and error, a lot of use of things like ZGOO to find undocumented features and a lot of painstaking iterate-save-test-redo to get things to do what they should be doing.
Yeah, I'm not surprised. What is this ZGOO that you're referring to, by the way? It sounds intriguing, and if it's something that's publicly accessible, I imagine it could help the rest of us too.
  Reply With Quote
02/27/14, 02:38 PM   #12
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Originally Posted by JonathanDark View Post
Yeah, I'm not surprised. What is this ZGOO that you're referring to, by the way? It sounds intriguing, and if it's something that's publicly accessible, I imagine it could help the rest of us too.
Look at the addons list on this very site
  Reply With Quote
03/02/14, 11:30 PM   #13
raykai
 
raykai's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 16
Originally Posted by JonathanDark View Post
Yeah, I'm not surprised. What is this ZGOO that you're referring to, by the way? It sounds intriguing, and if it's something that's publicly accessible, I imagine it could help the rest of us too.
ZGOO addon: http://www.esoui.com/downloads/info24-Zgoo.html
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Creating AddOns w/o BETA Access

Thread Tools
Display Modes

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