#Math inside another Math
1 messages · Page 1 of 1 (latest)
why would you do this though
%math_1_{mcmmo_level_axes}/50*6.5%
if you need the result of %mcmmo_level_axes%/50 rounded: %math_1_ROUND({mcmmo_level_axes}/50)*6.5%
its because the results are not right. The point is that i'm trying to show the extra damage a subskill gives to the player. The problem is it only adds 6.5 to the extra damage every 50lvls.
So, if i round it, when its not on a divisor of 50 it's going to give wrong results
So i was trying to make it a 50 divisor before making the multiplication so it's accurate
try this then
the sintax is wrong, i searched and tryed this instead:
%math_1:type_({mcmmo_level_axes}/50)*6.5%
I still don't understand how this would work but i tried any way with all the rounding possibilities: up, down, floor, ceiling, half-up, half-down and none worked...
The problem is that since we are telling it to leave 1 decimal space, then it will only try to round the results with 2 decimal spaces, wich doesn't always happens. For example:
lvl 260 -> 260/50*6,5 = 33,8
Expected result: 32,5 (it should show me the 250 lvl rank bonus)
And also, i would like to have the .5 numbers not rounded, since its the expected result most of the times
So, i apreciate the help, but rounding is not a solution for my problem unfortunately. But if you have any other ideia that spares me from doing a requirement condicion manually for all the 20 ranks that this sub skills has i would really appreciate it :)
As i said the syntax is wrong
its not right either... I looked up in the documentation e the right syntax format is:
%math_[decimals]:[rounding]_<expression>%
and even though it doesn't makes sense to use rounding for what i want to do, i still tryied every single type of rounding available: up, down, floor, ceiling, half-up and half-down and none of these did what i wanted as i explained to you. Them all returned me the value of 33,8 wich is not what i want
worked for me
i'm looking up in the devs documentation
what version are you in?
weird
1min
i'll run it again
WOW it's working know, i must have mistyped something the other time
thank you!!
but where did you found this syntax?
it's not in the documentation
the Math expansion uses the EvalEx library to evaluate math expressions
and that library provides a bunch of functions, including that FLOOR() one
here's the list
wow, really nice. I'll look more into it than, maybe it can help me with other things
Again thank you very much for the help <3
this might be more intersting
it has the actual function names that you can use in the expression
weird that ROUND didn't work, it's there tho
yeah, makes no sense. But in the log error i didn't see any mistype from my part. So it's really weird that one function works but not the other
well, what matters is that it's now working haha
yeah I tried as well and it didn't work
yeah 😅