View Single Post
09-17-17, 10:08 PM   #5
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
Originally Posted by myrroddin View Post
I could narrow it down to a single decimal, but currently I am not getting any errors and the color applied has changed, but I don't now if it is dynamic, hence the question.
Have I misunderstood the intent behind your code?
You are looking to have the exp bar start off as dark blue and slowly increase the amount of blue as the player character experience increases, right?

So let's say you're at 10% TNL, the code would run bar.statusBar:SetStatusBarColor(0, 0.1, 0.1, 1), and every time you gain experience the code would run again and set the status bar color again using the new value (so if you jumped from 10% TNL to 60% it would set the color to (0, 0.1, 0.6, 1))

I figured if you are having trouble seeing if the color change is actually working it may be because the color change is too subtle and you need to find a way to confirm it is indeed working. In that case having the color change to a random color every time you gain exp, regardless of the actual percentage-to-next-level, would be an easy way to notice that it's properly changing whenever you gain exp (otherwise it could be tested on a brand new Lv. 1 where you can go from 0% to 80% in one quest.)

In this case, if the random color assignment is properly working every time you are gaining exp, and the value of avg is also properly updating every time, you could reasonably determine that the code will work properly.

Is that not what you meant by dynamic? If I'm understanding it wrong, could you explain it further?

Last edited by Ammako : 09-17-17 at 10:12 PM.
  Reply With Quote