This is more of a math question, rather than how to write my scripts - i hope somebody is up for the task. 
I'm working on a game where i'm using the EXP bar as chargebar. Goes something like this:
Then, i'm using that value in later calculations to get stuff like power, accuracy, etc.
And all of that works fine, i'm making real good progress and it's a happy thing.
However, all of these calculations are linear. Instead, i would i prefer to apply an exponential function relative to the level of the {_charge}. But i don't how that would work at all.
Let's assume for example that "{_inaccuracy} = 50 %". How would i achieve that {_inaccuracy} grows exponentially between 0% and 50%, relative to the {_charge}, which is always a number between 0 and 1? Obivously somehow using the exp() functions, but ... well
Thanks for your time!
Nevermind, i solved it by messing around long enough:
Or let's at least say that's a step into the right direction, because that number im getting is growing too quickly! How would one go about making the growth smaller in the beginning and higher towards approaching 1?
I'm working on a game where i'm using the EXP bar as chargebar. Goes something like this:
code_language.skript:
set {_charge} to (level progress of event-player + 1)
Then, i'm using that value in later calculations to get stuff like power, accuracy, etc.
code_language.skript:
set {_strength} to {_item_strength} * {_charge}
set {_inaccuracy} to min({_inaccuracy},( {_charge} - 1))
And all of that works fine, i'm making real good progress and it's a happy thing.
However, all of these calculations are linear. Instead, i would i prefer to apply an exponential function relative to the level of the {_charge}. But i don't how that would work at all.
Let's assume for example that "{_inaccuracy} = 50 %". How would i achieve that {_inaccuracy} grows exponentially between 0% and 50%, relative to the {_charge}, which is always a number between 0 and 1? Obivously somehow using the exp() functions, but ... well
Thanks for your time!
Nevermind, i solved it by messing around long enough:
code_language.skript:
{_charge} = sqrt(level progress of event-player)
Or let's at least say that's a step into the right direction, because that number im getting is growing too quickly! How would one go about making the growth smaller in the beginning and higher towards approaching 1?
Last edited: