Mathematical Formulas in Choicescript


#1

I’ve been working on a couple games under wraps, but need to know if and how math formulas work in it…
so for now I have
*create defense ((armordef)*2)+(helmdef)+(shielddef)

Would this work as (armor defense ×2) plus (helmet) plus (shield)?


#2

I believe it only works to create and set.

*create defense 0
*set defense ((armordef)2)+((helmdef)+(shielddef))

Also you need to set parentheses around 2 statements when 3 or more are used.


#3

Try this, I tested it and everything

*create armor 5
*create helmet 5
*create shield 5
*create defense 0

*set defense (armor*2)+((helmet)+(shield))


${defense}

#4

@JimD
@ fantom
Thanks to both of you