#Math inside another Math

1 messages · Page 1 of 1 (latest)

wet elbow
#

Hy, does any one know if its possible to do a %math% inside another %math% ?

- '&5Dano Extra: &d%math_1_{math_0_{mcmmo_level_axes}/50}*6.5%'

I tryed this, but didn't work... :/

opaque cypress
#

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%

wet elbow
# opaque cypress why would you do this though

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

wet elbow
# opaque cypress 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 :)

opaque cypress
#

just use %math_1_ROUND({mcmmo_level_axes}/50)*6.5%

#

exactly as is

wet elbow
#

As i said the syntax is wrong

opaque cypress
#

wot

#

what about %math_1_FLOOR({mcmmo_level_axes}/50)*6.5% ?

wet elbow
#

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

opaque cypress
#

/papi info math

#

what's your Math expansion's version?

wet elbow
#

i installed it yesterday

opaque cypress
#

worked for me

wet elbow
#

i'm looking up in the devs documentation

wet elbow
opaque cypress
#

2.0.2 as well

wet elbow
#

weird

opaque cypress
#

can you show the new error msg?

#

with FLOOR instead of ROUND

wet elbow
#

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

opaque cypress
#

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

wet elbow
#

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

opaque cypress
#

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

wet elbow
#

well, what matters is that it's now working haha

opaque cypress
#

yeah I tried as well and it didn't work

opaque cypress