You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
I had a thought about a possibly better way to handle things like level-up equations and possibly death equations.
You could use String.format to basically build an equation and then evaluate it as the level-up/death equations.
So, for the exponential leveling curve in 1.20.1: String levelFunction=String.format("250 * 1.104088404342588^(1.1 * %d)",level);
Or the linear one: String levelFunction=String.format("250 + 500 * %d",level);
Then use javax.script.ScriptEngine to evaluate it and cache the value.
Then all the config would need is that string: "250 * 1.104088404342588^(1.1 * %d)"
Rather than the multiple variables needed, and the switch between leveling type.
Why is this feature needed
To make equations a little more friendly to edit and a lot more powerful.
Describe alternatives you've considered
Hugging Blåhaj.
Additional context
natural.1.mp4
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
I had a thought about a possibly better way to handle things like level-up equations and possibly death equations.
You could use
String.format
to basically build an equation and then evaluate it as the level-up/death equations.So, for the exponential leveling curve in 1.20.1:
String levelFunction=String.format("250 * 1.104088404342588^(1.1 * %d)",level);
Or the linear one:
String levelFunction=String.format("250 + 500 * %d",level);
Then use
javax.script.ScriptEngine
to evaluate it and cache the value.Then all the config would need is that string:
"250 * 1.104088404342588^(1.1 * %d)"
Rather than the multiple variables needed, and the switch between leveling type.
Why is this feature needed
To make equations a little more friendly to edit and a lot more powerful.
Describe alternatives you've considered
Hugging Blåhaj.
Additional context
natural.1.mp4
The text was updated successfully, but these errors were encountered: