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

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


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