
A Calculator
Gives your GM a calculator. When and why should you use this: Never to do formulas that could be in your schema instead. It's more expensive than a computed field. This is not for your GM to run the numbers with none of the help Craft provides in the back-end. Rather, when the GM is doing complex addition and subtraction with carrying, multiplication/division of any kind, or any of the other math operations that can make a grade school student sweat over a test, it's just as dumb as you. It will waste a *huge* amount of tokens verifying its result at best, at worst it will jump to a ridiculously wrong answer. How to use: Option 1: Inline with rules. This is best when you have a case where you know the GM will screw things up, like splitting gold, adding interest, etc. and don't want to waste a whole instruction on it. That said, it may skip in reasoning if it decides it's a genius and can't be bothered, the instruction route is a much stronger imperative if you have room. Something like "write <value> to calculator.a and <value2> to calculator.b and read 'calculator.add' all in one request in that order" Option 2: Instruction trigger. Make a rule that says something like: "Do math in your head only when a digit or two changes and nothing carries. Anything harder goes through the file named Calculator: in one update write its a and b as plain numbers, then read only the answer field you need: add, subtract (a minus b), multiply, divide (a divided by b), percentOf (b% of a), addPercent (a plus b%), subtractPercent (a minus b%), percentChange (a to b, in %). For a longer calculation, feed each answer into the next a. Never write the answer fields." Only list the operations your game actually uses. The GM can see the other fields when it reads the file, and a shorter list keeps the rule cheap. That’s all there is to it. What it can do: a and b are the inputs, and every other field computes itself from them: Field Result add a + b subtract a − b multiply a × b divide a ÷ b percentOf b% of a addPercent a increased by b% subtractPercent a decreased by b% percentChange percent change from a to b asPercent a as a percent of b difference distance between a and b, never negative average average of a and b min / max lower / higher of a and b remainder remainder of a ÷ b wholeDivide a ÷ b, rounded down to a whole number power a to the power of b root the b-th root of a (b = 2 is the square root) Good to know: Percent fields: b is always the percent, and 5 means 5%. Plain numbers only: the inputs take numbers like 48310, not "$48,310". Dividing by zero: you get an empty answer instead of an error. Same for percentChange when a is 0. No rounding: answers come back exact, so your rules decide how to round. One shared file: each calculation overwrites the last one. It’s a scratchpad, so don’t keep results in it.