How do I reset my experience points bar to empty without the player losing exp (UMG)
Hey everyone, I have a level up system and I'm using a UMG progress bar to displayer the experience if the player.
It works fine but the bar jumps to the current exp value along the bar when the new exp threshold is set. How do I reset the bar to a zero state without having an effect on the players exp?
Level up function in the Character BP
UMG Widget Binding
asked Nov 10 '14 at 11:56 AM in Blueprint Scripting
You need two pieces of data. Think about the trip counter on your car, you have the miles this tank and the total mileage. Use an integer (or float) for a trip counter (current experience counter) and when it reaches its limit, add its value to the total experience, and reset the current experience counter to zero.
Hope this helps
answered Oct 30 '15 at 10:29 PM
Your inputs are backwards in the UMG Widget binding. What you have set is Current Exp/Max XP. Flip them around so that they are Max XP/Current XP.
answered Nov 10 '14 at 12:16 PM
Broaden the scope with 2 more floats?
A second setup on a smaller scale specifically for the widget. Current XP this level - start at zero - recieve XP input at the same time current XP does. Max XP this level - compare float. If Current xp >= Max XP this level, ding.
You can set and use both of these variables in the exact setup you have now. You can wipe these at Ding and set a new Max XP this level per level called from .csv.on Ding. You can do this without affecting the cumulative total.
Current XP will still hold a cumulative value. Max XP will still set an upper ceiling.
If you don't want to use .csv - a quick and dirty method is to get the current Max XP for level and apply a multiplier before set.
Follow this question
Once you sign in you will be able to subscribe for any updates here