🔢
Math
base.mathBase SetUtilityRuns an arithmetic expression and stores the answer as a Spark. Add scores, calculate percentages, multiply rewards — if numbers are involved, this piece does the work.
When to use this
- →Supports +, -, *, /, and parentheses: ({{a}} + {{b}}) * 2
- →Tip: for simple +1/-1, use Write to Vault's built-in + Add / − Sub mode instead
On the canvas
This is what Math looks like when you place it on your flow. Each field below is something you configure in the inspector panel.
🔢Utility
Math
base.mathexpressionrequired
{{result.0.coins}} + 10
asrequired
newScore (becomes a Spark!)
Config fields
| Field | Type | Req | What it does |
|---|---|---|---|
expression{{result.0.coins}} + 10 | text | yes | The calculation 🧮 |
asnewScore (becomes a Spark!) | text | yes | Name the result ✨ |
Sparks this piece adds
After this piece runs, these values are available as sparks in every node downstream.
{{total}}numberMath calculation resultOutput ports
outputMoves on with the calculation result as a Spark
📐
In TypeScript, this would be…
Not something you need to write — just a look at what Kitcord does for you.
TypeScript
const newCoins = Number(result[0].coins) + 10;
// Expression: {{result.0.coins}} + 10 → {{newCoins}}More Utility pieces