ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Creating AddOns w/o BETA Access (https://www.esoui.com/forums/showthread.php?t=87)

Capadillo 02/22/14 01:14 AM

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

Lyeos 02/22/14 10:53 PM

Quote:

Originally Posted by Capadillo (Post 463)
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 :)

Capadillo 02/22/14 11:36 PM

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! :)

ESOljl 02/22/14 11:43 PM

I believe the api has been released, according to this thread http://www.esoui.com/forums/showthread.php?t=80

Capadillo 02/22/14 11:48 PM

Quote:

Originally Posted by ESOljl (Post 490)
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. :(

Xrystal 02/23/14 05:01 AM

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.

JonathanDark 02/23/14 02:18 PM

Quote:

Originally Posted by Xrystal (Post 496)
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. :D

Capadillo 02/23/14 10:20 PM

Quote:

Originally Posted by JonathanDark (Post 514)
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. :D

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.

Xrystal 02/24/14 03:00 PM

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.

Wykkyd 02/27/14 11:21 AM

Quote:

Originally Posted by JonathanDark (Post 514)
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. :D

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 ;)

JonathanDark 02/27/14 02:17 PM

Quote:

Originally Posted by Wykkyd (Post 639)
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.

Wykkyd 02/27/14 02:38 PM

Quote:

Originally Posted by JonathanDark (Post 644)
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 ;)

raykai 03/02/14 11:30 PM

Quote:

Originally Posted by JonathanDark (Post 644)
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


All times are GMT -6. The time now is 03:03 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI