I would like to know if there is a list or a tutorial on how to use the formula in the button tooltip, like hidden operations that needs special format in order to work.
To clarify, I just want to use Powers in the tooltip. The only thing I know is that we can use the standard operations + - * / but not powers (I tested with ^ doesnt work)
Is there something I should be aware of about all of this?
My brother says have the button reference a dummy data object that triggers then update to the correct value using a catalog trigger since triggers can support the needed calculations.
Else you will need very long formulas using a rearrangement of Adapted Newton's approximation (Newton-Raphson).
In my experience, <d ref/> doesn't support order of operations the way it should. You need to bracket operations you want done first, like mult/divison for example. The operation goes from left to right, it doesn't care if there are * or / signs later on in the func. I don't know how others do it, but I personally use damage effect as it can support tons of stats. Although to be honest, I'm sure effects like search can too.
Be careful with CatRef though, I highly recommend using universal base values for simple calculations and CatReffing only the harder to calculate values. CatRef has a finite limit after which your map starts leaking :<. And when it does your map will be un-exitable lol!
So you can have something like
Effect-Type: Damage, Name:LaserStats
Amount: 10
AttributeBonus[Biological]: 1.75
Your button tooltip:
Shoots a laser at target, dealing <d ref="Effect,LaserStats,Amount" precision="1"/> damage. If the target is slowed, it takes <d ref="(Effect,LaserStats,AttributeBonus[Biological]*Effect,LaserStats,Amount)+5" precision="1"/> bonus damage.
It' look like this:
Shoots a laser at target, dealing 10 damage. If the target is slowed, it takes 22.5 bonus damage.
Also another thing is, the calculations are rounded to the nearest integer if you don't give it any precision value. Precision is just basically, how many decimal points it shows. If I didn't put precision, the bonus damage would have been 23. If the final calculation is a whole, it won't show the 0 decimal values even with precision values.
Hello,
I would like to know if there is a list or a tutorial on how to use the formula in the button tooltip, like hidden operations that needs special format in order to work.
To clarify, I just want to use Powers in the tooltip. The only thing I know is that we can use the standard operations + - * / but not powers (I tested with ^ doesnt work)
Is there something I should be aware of about all of this?
Can it support logs?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@VisionElf: Go
Seems obscure, I'd bet money that neither logs nor exponents are supported in tooltip formulas.
<Click Here> To See My Epic Single Player Campaign (LifeForceCampaign.com)
My brother says have the button reference a dummy data object that triggers then update to the correct value using a catalog trigger since triggers can support the needed calculations.
Else you will need very long formulas using a rearrangement of Adapted Newton's approximation (Newton-Raphson).
http://math.stackexchange.com/questions/462443/calculating-non-integer-exponent
Or a continued fraction representation
http://math.stackexchange.com/questions/62203/how-can-i-calculate-non-integer-exponents
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
In my experience, <d ref/> doesn't support order of operations the way it should. You need to bracket operations you want done first, like mult/divison for example. The operation goes from left to right, it doesn't care if there are * or / signs later on in the func. I don't know how others do it, but I personally use damage effect as it can support tons of stats. Although to be honest, I'm sure effects like search can too.
AttributeBonus (13 values)
AttributeFactor (13 values)
Amount (1 value)
AreaArray (144 values)
Be careful with CatRef though, I highly recommend using universal base values for simple calculations and CatReffing only the harder to calculate values. CatRef has a finite limit after which your map starts leaking :<. And when it does your map will be un-exitable lol!
So you can have something like
Effect-Type: Damage, Name:LaserStats
Amount: 10
AttributeBonus[Biological]: 1.75
Your button tooltip:
Shoots a laser at target, dealing <d ref="Effect,LaserStats,Amount" precision="1"/> damage. If the target is slowed, it takes <d ref="(Effect,LaserStats,AttributeBonus[Biological]*Effect,LaserStats,Amount)+5" precision="1"/> bonus damage.
It' look like this:
Shoots a laser at target, dealing 10 damage. If the target is slowed, it takes 22.5 bonus damage.
Also another thing is, the calculations are rounded to the nearest integer if you don't give it any precision value. Precision is just basically, how many decimal points it shows. If I didn't put precision, the bonus damage would have been 23. If the final calculation is a whole, it won't show the 0 decimal values even with precision values.