Thread Tools Display Modes
11/10/14, 01:58 AM   #1
justinbarrett
Join Date: Nov 2014
Posts: 25
GetUnitXP returning odd value

is this
Code:
GetUnitXP("player")
returning the wrong value for veterans? I thought veterans went to normal xp and we dropped
Code:
GetUnitVeteranPoints("player")
it does check beforehand if the *player exists, so it is not an empty pointer...not sure how you reffer to this exactly in LUA, but I'm sure I am understood here
Anyway am I just wrong, a current known issue, or possibly initialized incorrectly by me?
I fill a local variable upon initialization just to get a value in there...any help is appreciated.
  Reply With Quote
11/10/14, 08:05 AM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Just guessing here... Since veteran points functions still exist, I'd say they made that change more on the presentation level, while API remained nearly the same.

Lua Code:
  1. -- from playerprogressbar.lua
  2. function ZO_PlayerProgressBarCurrentFragment:RefreshBaseType()
  3.     if(self:IsShowing()) then
  4.         if(GetUnitVeteranRank("player") > 0) then
  5.             PLAYER_PROGRESS_BAR:SetBaseType(PPB_VP)
  6.         else
  7.             PLAYER_PROGRESS_BAR:SetBaseType(PPB_XP)
  8.         end
  9.     else
  10.         PLAYER_PROGRESS_BAR:ClearBaseType()
  11.     end
  12. end

PPB_VP uses GetUnitVeteranPoints("player"), GetUnitVeteranRank("player"), GetNumVeteranPointsInRank(rank) where
PPB_XP uses GetUnitXP("player"), GetUnitLevel("player"), GetNumExperiencePointsInLevel(rank)

edit: a bit strange that they use GetUnitVeteranRank("player") > 0 to check you're veteran, in other places they still use IsUnitVeteran("player") so that function wasn't removed, either.

Last edited by merlight : 11/10/14 at 08:09 AM.
  Reply With Quote
11/10/14, 08:14 AM   #3
mra4nii
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 42
So far is just a cosmetic change. They changed just the name of those points for now.
All API functions related to veteran points/ranks are still there and in use.
  Reply With Quote
11/10/14, 08:50 AM   #4
justinbarrett
Join Date: Nov 2014
Posts: 25
ok, I can check on int. to get those two different variables returned, but I would rather just do it once....
does anyone have a clue about what the future of this will be in the api? do we need to maintain this or is it a good time to ignore the vet stuff and just focus on the normal xp? I know this is a shot in the dark question.
  Reply With Quote
11/10/14, 01:24 PM   #5
vali
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 1
I checked XP and VP yesterday with a veteran char and those functions return different values (more XP than VP), but right now XP gains seems to be equal to VP gains, at least when you complete a quest or kill some mobs. The amount of VP you get through quests or completing POIs is a lot lower than before.
  Reply With Quote
11/13/14, 07:20 AM   #6
justinbarrett
Join Date: Nov 2014
Posts: 25
well using this..
Code:
xpMax = GetUnitVeteranPointsMax("player")
It is returning 4 millon into the variable???
any idea where this number is coming from?...or how I can get the correct value?
it IS giving correct results for the current amount....so it seems the function is working fine.
  Reply With Quote
11/13/14, 09:10 AM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
That's probably related to a bug reported since the last patch.

edit: http://forums.elderscrollsonline.com...h-notes-v1-5-4

Last edited by merlight : 11/13/14 at 10:03 AM.
  Reply With Quote
11/13/14, 10:31 AM   #8
justinbarrett
Join Date: Nov 2014
Posts: 25
ty, but that doesn't really tell me anything specific about what, if any, changes happened in that function...or if another(or new)function was created....or if they are aware of the issue.
  Reply With Quote
11/13/14, 10:33 AM   #9
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
It tells you that the function returning 4mil is bugged, and will be fixed later.
  Reply With Quote
11/13/14, 11:11 AM   #10
justinbarrett
Join Date: Nov 2014
Posts: 25
Ahhhh!!! I sincerely apologize, I just saw the line that says exactly that....I apparently did something wrong when I did a ctrl+f search of the page...because hey, I'm a lazy SOB ...ty...I do not know what I would do without this forum...and all the help you circonian and a few others have given me ty .
  Reply With Quote
11/14/14, 05:28 AM   #11
justinbarrett
Join Date: Nov 2014
Posts: 25
ofc now....it is returning 1,000,000 but the eso xp bar is showing 4,000,000?
  Reply With Quote
11/14/14, 05:34 AM   #12
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
I guess you picked the wrong time for this kind of tool Maybe check other add-ons that work with exp bars, there's quite a few. If they have problems, too, I'd lay it off till reported values are fixed
  Reply With Quote
11/14/14, 06:15 AM   #13
justinbarrett
Join Date: Nov 2014
Posts: 25
Yes, I certainly could not have timed this worse
and I checked foundary tactical combat, as well as, the war genesis addons...and they are returning the same values as mine...so I know I am not crazy

I'm hoping ZOS irons this out....it is almost certainly not that hard to fix....maybe it is not a priority?
  Reply With Quote
11/14/14, 10:07 AM   #14
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
Originally Posted by justinbarrett View Post
I'm hoping ZOS irons this out....it is almost certainly not that hard to fix....maybe it is not a priority?
It's a "known issue"... Patch notes for 1.5.4
  Reply With Quote
11/14/14, 07:49 PM   #15
justinbarrett
Join Date: Nov 2014
Posts: 25
yes ty, I assumed they addressed it...and I did see the patch notes soon after my last post...so basicly they broke their internal xp interface, and mine is actually correct now....odd...It seems like more changes will be coming in general to xp....I don't think this is the last of it.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » GetUnitXP returning odd value

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