I’m adding a cooking skill that increases incrementally. I have this displayed as a whole level, plus a progress bar to show the percentage to the next whole number. I’m having an issue where the progress bar will sometimes display as full on the whole number, and sometimes display as empty on the whole number. Please see attached images.
I’d like it to display as empty once it reaches the next whole number. Any ideas on how to fix this?
I’m not sure about how you’re using “fraction” in there, but that may very well be fine, but perhaps run a separate function each time you add cooking skills. It may also be having a difficult time doing the math as a fraction when exceeding the max value and instead displaying a whole value…
Once the logic is complete when adding skill to the float variable get your cooking skill variable and run it through a branch and check if it is = > (equal to or greater than) your desired max cooking skill and if true set the cooking skill variable back to zero…
You could add another variable like an integer and call it “SkillLevels” and add +1 to it each time you exceed that max value to store and track how many times you’ve reached max skill in that tier or whatnot.
P.s. their are a lot of functions available in the float library that can display cool looking information like “percentage” I believe it’s called and you can set the max integral digits and stuff to get the desired effect. So it can say 0.9%, .90% or just 90% and so on. You can also use “append” to affix the percentage symbol to the beginning or end and “ChopLeft” or “ChopRight” to rid of values you don’t want.
Thanks for the response. I divided the skill like you mentioned, creating the variable “CookingLevel” as an integer, and “CookingEXP” as a float. I created a function that adds to CookingEXP when a button is hit. Then it checks if CookingEXP >=1, and if true, it adds 1 to CookingLevel and subtracts 1 from CookingEXP.
However, the branch is not returning as true when CookingEXP is right on 1.0 and I’m adding in 0.1 increments. It returns as false, and CookingLevel is not updated.
I don’t know what could be causing this. If I add to CookingEXP in other increments, like 0.2, it correctly resets at 1.0
Any ideas?
Update: I’ve also now tried adding in increments of 1, 0.5, 0.25, 0.2, and 0.05. They all correctly update at level 1. Only the 0.1 increment has a problem
I created an example project with a progress bar which includes:
A widget which shows your current progress
A DataTable with the max. level experiences for each level
Functions for:
3.a. Loading previous Level and Experience
3.b. Setting up all important values on EventConstruct
3.b. Simluating gaining Experience
3.c. Taking into account experience over 100% => 205/200 => next level has 5
All functions are commented and are hopefully helpful for you
That is odd it’s not working at “1”… Have you printed this value to ensure it’s right at “1”? You may try adding another check that is == 0 and connect it to the same branch, but use and “OR boolean” to connect both the checks to the branch.
It would read something like is CookingEXP greater than or equal to 1(>=) OR is CookingEXP equal to 1(==)…
I’m not sure why it’s not returning true at 1, that’s tricky…