Thread Tools Display Modes
04-26-17, 09:06 PM   #1
SuperRookie
A Deviate Faerie Dragon
Join Date: Apr 2017
Posts: 11
UnitAlternatePowerInfo returns nothing!

Title says pretty much all.

Wowprogramming.com says that UnitAlternatePowerInfo should return various infos with input of unitID or name.

So I dumped it and it returns empty

Code:
/dump UnitAlternatePowerInfo("player")
I've tested it on feral druid, shadow priest and so on.

Any ideas, please?
  Reply With Quote
04-26-17, 09:39 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
I don't believe this is for say mana when a druid is in cat form, rather when you are in an event or quest that shows an alternate power bar eg. the bar that shows when doing the Ley Mana Race WQ.

From the UnitPowerBarAlt code:

Code:
	
elseif ( event == "UNIT_POWER" ) then
    if ( arg1 == self.unit and arg2 == "ALTERNATE" ) then
	local barType, minPower = UnitAlternatePowerInfo(self.unit);
	local currentPower = UnitPower(self.unit, ALTERNATE_POWER_INDEX);
...
The WoWProgramming description is a bit vague.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-26-17 at 09:47 PM.
  Reply With Quote
04-26-17, 11:26 PM   #3
SuperRookie
A Deviate Faerie Dragon
Join Date: Apr 2017
Posts: 11
Originally Posted by Fizzlemizz View Post
I don't believe this is for say mana when a druid is in cat form, rather when you are in an event or quest that shows an alternate power bar eg. the bar that shows when doing the Ley Mana Race WQ.

From the UnitPowerBarAlt code:

Code:
	
elseif ( event == "UNIT_POWER" ) then
    if ( arg1 == self.unit and arg2 == "ALTERNATE" ) then
	local barType, minPower = UnitAlternatePowerInfo(self.unit);
	local currentPower = UnitPower(self.unit, ALTERNATE_POWER_INDEX);
...
The WoWProgramming description is a bit vague.
Damn.... I got baited lol...

Thanks for the clarification, Fizz!
  Reply With Quote
04-27-17, 12:26 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
The druid mana or energy when in cat form or mana vs insanity type situations are handled via the normal UNIT_POWER/UNIT_POWER_FREQUENT event(s). You just have to keep track of your current form/spec etc. to know what power types you are looking for and the event parameters tell which "power" is being updated.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-27-17 at 01:03 AM.
  Reply With Quote
04-27-17, 08:28 AM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
UnitPower() takes an optional second argument. This is how you query mana when in cat/bear form, for example.

http://wowprogramming.com/docs/api/UnitPower
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » UnitAlternatePowerInfo returns nothing!


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