#(JustinS) "Complicated" maths in denizen

50 messages · Page 1 of 1 (latest)

opaque steppe
#

Im trying to use the following formula in my script:
2^(-1.55-1.5x)
Where x is: <script[item_force_stun].flag[variables.base_strength]>
My attempt:
- adjust <[target]> speed:<[2].power[<script[item_force_blinding].flag[variables.base_strength]>.mul[-1.5].sub[1.55]]>
I know the [2] is wrong and the .mul[a].sub[b] as well though I have no idea how to do this correctly. Is there a doc that shows how to do this? Couldnt find it

dense fiberBOT
#

(JustinS) "Complicated" maths in denizen

dense fiberBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

twin bone
#

I mean this just looks wrong
<[2].power[<script[item_force_blinding].flag[variables.base_strength]>.mul[-1.5].sub[1.55]]>

#

You don't have to one-line this, you can do some calcs separately and then put it all in one tag, it helps with readibility

opaque steppe
#

I dont get that

#

How do I write an integer

keen relicBOT
opaque steppe
keen relicBOT
hazy grove
#

you have 1.mul...

#

so again

#

element 1

#

oh no

#

<script[item_force_blinding].flag[variables.base_strength]>.mul[x] doesnt make sense

twin bone
opaque steppe
#

the base_strength flag is a decimal

keen relicBOT
hazy grove
opaque steppe
#

oh the mul[x] should be inside the <>

twin bone
#

Yes, you never add a subtag to a bracket

opaque steppe
#

yeaa

#

So... <element[2].power[<script[item_force_blinding].flag[variables.base_strength].mul[-1.5].sub[1.55]>]>

#

ooooooh that works

#

in the opposite way that it should

#

its giving the player a speed boost but it supposed to slow them down lol

#

Oh I got it wrong

#

the standard is 0.1 not 0.5

#

Ill just divide everything by 5

onyx cloak
opaque steppe
#

huh

onyx cloak
#

(def-fiyed numbers for slightly more readability)

opaque steppe
#

thats what its supposed to be

onyx cloak
#

that's gonna math poorly

opaque steppe
#

what you wrote is

onyx cloak
#

ye

opaque steppe
#

welp it works

#

thanks guys!

robust roostBOT
#
Resolved

Thread closed as resolved.

onyx cloak
#

<[2].power[<element[<[-1.55].sub[<[1.5].mul[<[x]>]>]>]>]> should work if you needed to one-line it?

opaque steppe
#

oh

robust roostBOT
#
Thread Reopened

Thread was manually reopened by @opaque steppe.

opaque steppe
#

cut you off

onyx cloak
#

I was just repeated what was already said

#

you good