Skip to main content

Stat

This formula is, perhaps, the most important. Yet, it's also the ONLY ONE that does not follow the pattern for formula type names. Please pay extra attention to this, as this formula type is "stat" ((ノ◕ヮ◕)ノ*・゚✧) and not "getStat" ((ʘ_ʘ)).

It allows you to fetch the value of any stat that you have access to. This can be done directly or by providing a stat path. For example, if you have a stat with id "spell", you could do something like "spell.name" to access the stat "name" under the spell resource you just accessed directly.

Note that accessing a stat that doesn't exist will result in an exception ( exceptions... bad... bad exceptions... we don't want exceptions), as will trying to access stats in a path where a previous path component was null ( e.g: in our example, if "spell" is currently null, doing "spell.name" would throw an exception and explode, very bad stuff). To avoid this you have several options:

  1. Check the existence and non-nullability of stats with the Defined and NotNull stat formulas in conjunction with the When stat formula, to avoid trying to access things that aren't there. Or...

  2. Use the conditional path character ? in your path. When specifying a path in this formula component, you can suffix any component of the path with ? (a component is anything between dots) to signal that, should that path component be non-existent or null, the path lookup should stop and null should be returned instead. So, in our previous example, we could do "spell?.name" to prevent this from being a problem. The conditional operator ? is going to be your best friend in a lot of situations!

JSON Format

{
"type": "stat",
"stat": ...,
"for_resource": ...,
"ignore_cache": ...
}

Fields

FieldTypeRequiredDescription
statStringThe path to the stat you want the value of (read the beautiful explanation at the top of this page for details on syntax).
for_resourceStatFormulaComponentDeprecated, please don't use and ignore.
ignore_cacheboolWhether the internal caching system should be circumvented when fetching this stat. This should be only used as a last resource and avoided at all costs. If you find yourself needing to use this, please contact the app developer by sending an email to feedback@blastervla.com to ensure you should be using it and this is not because of an app bug that should be fixed instead. This property has performance implications.