Thread Tools Display Modes
03/15/15, 08:00 PM   #1
justinbarrett
Join Date: Nov 2014
Posts: 25
GetBounty() help

I previously posted this in, what I believe is the wrong forum by mistake.
here
http://www.esoui.com/forums/showthread.php?t=4436
feel free to remove that post.

anyway my problem...
While using GetBounty() I noticed it is not returning the same value as shown in my character screen...I am thinking it goes off a multiplier or associated with a cooldown, but have not worked it out...and I am having trouble understanding exactly what that function is returning...any advice would be appreciated...just trying to get my result to match the character screen.
  Reply With Quote
03/15/15, 08:46 PM   #2
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
I've did some test for a personnal adon, but hadn't any issues with it..


Little debug :

Lua Code:
  1. function TimeIsMoney.updateTimer(_, oldInfamy, newInfamy, oldInfamyLevel, newInfamyLevel)
  2.     d("oldInfamy:" .. oldInfamy .. " newInfamy:" .. newInfamy .." oldInfamyLevel:" .. oldInfamyLevel .." newInfamyLevel:" .. newInfamyLevel)
  3.    
  4.     TimeIsMoney.bounty = GetInfamy()
  5.    
  6.     local heat, bounty = GetPlayerInfamyData()
  7.     d(heat)
  8.     d(bounty)
  9.     d(GetBounty())
  10.     d(GetReducedBountyPayoffAmount())
  11.     d(GetFullBountyPayoffAmount())
  12.     d(GetInfamyMeterSize())
  13.    
  14. end
  15.  
  16. -- Addon activation
  17. EVENT_MANAGER:RegisterForEvent(TimeIsMoney.name, EVENT_JUSTICE_INFAMY_UPDATED, TimeIsMoney.updateTimer)
  Reply With Quote
03/15/15, 08:55 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by justinbarrett View Post
While using GetBounty() I noticed it is not returning the same value as shown in my character screen...I am thinking it goes off a multiplier or associated with a cooldown, but have not worked it out...and I am having trouble understanding exactly what that function is returning...any advice would be appreciated...just trying to get my result to match the character screen.
When you say its not showing the same values, I'm am assuming you mean the amount of gold.

The Payoff, Bounty, & Infamy are not the same thing. On the radial meter you see on the screen you will see it fill up with 2 colors. The Red part is the infamy, the white part is the bounty, the gold is the PayoOffAmount.

Instead you need to use this to get the payOff amount shown on the screen:
Lua Code:
  1. GetFullBountyPayoffAmount()


GetBounty, is the amount (number/value) used to determine the ending percentage values for the bounty bar animation (at what percent the white bar fills up the radial bar).
Lua Code:
  1. -- The white Bounty Radial bar, will be this full (percentage full)
  2. HUD_INFAMY_METER.bountyBar.endPct = GetBounty() / GetInfamyMeterSize()

Last edited by circonian : 03/15/15 at 08:59 PM.
  Reply With Quote
03/16/15, 01:17 AM   #4
justinbarrett
Join Date: Nov 2014
Posts: 25
ty both, my question is where did you find these functions....I am a bit ignorant in that department, and yes Circonian, that was exactly my issue....looking for the gold amount calling the completely wrong function due to ignorance.

and one more question, what is a good event to use for this...I only found one justice event on the wiki...

I'm such a tool, after some research I found this
http://forums.elderscrollsonline.com...og-live#latest
I never look there...

Last edited by justinbarrett : 03/16/15 at 06:30 AM.
  Reply With Quote
03/16/15, 09:45 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by justinbarrett View Post
ty both, my question is where did you find these functions....I am a bit ignorant in that department, and yes Circonian, that was exactly my issue....looking for the gold amount calling the completely wrong function due to ignorance.

and one more question, what is a good event to use for this...I only found one justice event on the wiki...

I'm such a tool, after some research I found this
http://forums.elderscrollsonline.com...og-live#latest
I never look there...
Ah, I hadn't seen that post. You can view some of the code files here, thats were I got it from. I just looked through the code for calls to GetBounty() then read the code to see what it does: http://esodata.uesp.net/current/index.html

there is this event:
Lua Code:
  1. EVENT_JUSTICE_BOUNTY_PAYOFF_AMOUNT_UPDATED (integer eventCode, integer _oldBounty_, integer _newBounty_)
I got that off of the wiki events page: http://wiki.esoui.com/Events
But, it says the parameters are eventCode, oldBounty, & newBounty.
The keywords are bounty. Remember the payoff amount is not the bounty. But when that event fires it the game calls:
Lua Code:
  1. function ZO_BountyDisplay:OnBountyUpdated()
  2.     if IsJusticeEnabled() then
  3.         ZO_CurrencyControl_SetSimpleCurrency(self.control, CURRENCY_TYPE_MONEY, GetFullBountyPayoffAmount(), self.currencyOptions, CURRENCY_SHOW_ALL, self.playerOwesGold)
  4.     end
  5. end

Which is when/where they update the gold label payoffAmount you see on the screen, so if you update yours when that even fires it will work just fine. Just don't forget. Don't use those oldBounty, newBounty parameters, you'll have to call: GetFullBountyPayoffAmount()
  Reply With Quote
03/16/15, 11:39 PM   #6
justinbarrett
Join Date: Nov 2014
Posts: 25
thanks again, I got it all ironed out just before my previous post edit. It was extremely easy, I just didn't have the correct function or event(so everything ).
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » GetBounty() help


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