Docs/Dynamic Components

Calculations

A Calculation is one number worked out from the Numeric Facts on your Glossary Items, such as Mara's Cold minus half of her Stamina. Nothing shows it to your Reader. Wherever the book asks for a number, you can type one or pick a Calculation instead. A Dice Template Modifier, a Trade Screen Stock Change, a Combat Ability's damage and a Trigger result are a few of those places. With a Calculation, the number follows the story.

Where to find it

You can find Calculations in the sidebar, under Dynamic Components. The list shows every Calculation in this book with what it adds up to, in the same words the editor uses. Add Calculation creates a new one. Pressing a card opens it in the editor.

Note
Calculations work differently from the other Dynamic Components. Nothing starts one, not even a Trigger, and your Reader never opens one. Other pieces of the book read a Calculation when they need a number. On its own it does nothing, and that is normal.

Before you start

A Calculation adds up Numeric Facts and nothing else, so one thing has to be true first:

  • A Glossary Item with a Numeric Fact. A Fact is a detail on a Glossary Item, added on its Fact Card. A Numeric Fact holds a number, such as Stamina: 40. Facts of any other kind cannot be added up, so a row never offers them. With no Numeric Fact in the book, Add Calculation says so instead of opening.

A row is a share of one number

Take [50] % of [Mara] 's [Stamina]

Each row reads as that sentence, and holds three picks:

  • Take [ ] %: how much of the number this row uses. 100 is all of it, 50 is half. It takes whole numbers from 1 to 100. A number bigger than the Fact itself needs a second row or a "Multiply by" adjustment.
  • Whose number?: the Glossary Item that carries the Fact. Every Glossary Item in the book is listed. Once picked, one with no Numeric Fact says so, and where to add one.
  • Which number?: one of that item's Numeric Facts. Only they are listed.

A Calculation holds up to 10 rows. Add another row, under the rows, has two buttons: Add and Take off. They decide the new row's sign. The bin in a row's corner removes that row, unless it is the only one left.

How rows join

Added, or taken off, top to bottom

Between two rows sits the second row's sign: + Add this row or - Take this row off. It can be flipped there at any time. The first row has no sign, because there is nothing above it yet. Rows are worked out in order: 100% of Cold, minus 50% of Stamina, plus 10% of Luck.

Adjusting one row

then [No adjustment]

Once a row has its Fact, a quieter line appears under it. It is optional: a fixed number applied to that row's share only, before it joins the total. The other rows are not touched.

  • Add a fixed amount or Subtract a fixed amount: "Take 100% of Morale, then subtract 1" makes Morale minus 1.
  • Multiply by or Divide by: "Take 50% of Strength, then multiply by 2" makes Strength again. Both need at least 1.

A row reads one Numeric Fact, never another Calculation. Arithmetic you want to reuse has to be built again.

What it adds up to

Adds up to

The box under the rows reads the whole Calculation back as one line, such as "100% of Mara's Cold - (50% of Mara's Stamina - 1)". Once every row has its Glossary Item and Fact, the box also says what that makes from the Facts' values in your book today. While the story is read, the number follows whatever those Facts say at that moment, rounded to a whole number. So the same Calculation can be 12 in one Chapter and 40 in another. The card in the list shows the same line. The box starts folded, with today's number beside its title. Pressing the title opens it.

For example: Lockpicking, step by step

The demo at the top of this page carries this Calculation on its second tab, in the window's own words. The sample book's Lockpicking (Dexterity + half Luck) has two rows: Take 100% of Ishmael's Dexterity, then + Add this row: Take 50% of Ishmael's Luck. With Dexterity at 12 and Luck at 6, the book works it out top to bottom:

  1. Row 1: 100% of 12 is 12.
  2. Row 2: 50% of 6 is 3, and it is added, so 12 + 3 = 15.
  3. The result is rounded to a whole number. Had Luck been 7, half of it is 3.5 and the total 15.5 rounds to 16.

Suppose row 2 gets a then line: Subtract a fixed amount of 1. The adjustment applies to that row's share before the row joins the total. So row 2 becomes 3 minus 1 = 2, and the total is 12 + 2 = 14.

A total can go below zero. When the room costs more than the purse holds, Take 100% of Coins minus Take 100% of Room rate is a debt. A Fact that has never been set counts as 0.

Where the number is picked up

Number or Calculation

Wherever the book asks for a number, two buttons sit next to the box: Number and Calculation. The second opens a dropdown of your Calculations by name, and picking one there is the whole connection. These are the places that offer it:

  • A Dice Template Modifier: how much to add to or take off the roll.
  • A Trade Screen Stock Change: how many of an item to put on the shelf.
  • A Combat Ability under a fighter's Combat Settings: its damage. And on the same screen, that fighter's health, energy or shield.
  • A Dice Template's number to beat, and what happens after the roll.
  • A Combat Template: the number that a group's or a Combatant's rule compares against, and what happens after the combat.
  • What a choice does on a Decision Template, and what a reply does on a Dialogue Template.
  • A Trigger rule, or a result that increases or decreases a Numeric Fact: by how much. A Calculation that reads the very Fact being changed is left out of that list, because it would feed itself.

Used by

At the bottom of the Calculation's own window, Used by lists everything in the book that reads this number, and where inside each one. It starts folded, with the count beside its title. Until something reads it, Used by says so, and repeats where a Calculation can go. The list card in Dynamic Components carries the count of the same list.

The delete question is built from the same list, so pressing Delete names exactly what will stop working.

What your Reader sees

Nothing with the Calculation's name on it. Your Reader never opens one and never sees the sum. They meet the number where it is used. In a dice roll it flies in over the die with a plus or minus, such as +15. The roll's Modifiers tab shows the same amount beside the Modifier's name, such as Deft hands. At a counter it is how many of an Item are on the shelf. In combat it is the damage a move does. In a Trigger result it is how much a Fact changed by. The Reader reads the name of the thing that uses it, such as the Modifier. The Calculation's own name is only for you.

Published Calculations

Once a Calculation is published, it locks. Its card in the list shows a lock and no longer opens. Duplicate, which appears when you hover over the card, makes a copy with (Copy) added to the name, and the copy can be edited.

The published one changes in an Edition, started from your Published page. There it opens while the Edition works on the part it was published with, and your change goes out with the Edition when you publish it. The Publishing page says what Readers in the middle of the book see.

Validation

A Calculation can break in two ways. The list marks a broken one with a warning icon and says which row. The sidebar flags Calculations too, and the publish check rejects any book that contains a broken one.

  • A row reads a Glossary Item or a Fact that has since been deleted.
  • A row reads a Fact whose kind changed from Numeric to something else. Calculations can only read Numeric Facts.

In the window, the broken row keeps whose number it was, with a warning where the Fact used to be. Picking one of that item's Numeric Facts again, or removing the row, fixes it once saved.

Deleting a Calculation that is in use breaks whatever reads it. That can be a Dice Template Modifier, a Trade Screen's Stock Change, a Combat Ability or a Trigger result. Each one is marked broken until it points somewhere else. The delete question lists them first, so you can keep it, or fix what breaks afterwards.

Questions writers ask

The same questions and answers sit behind the "?" in the Calculation window.

How this fits your story

I saved my Calculation and nothing happened. What is it for?

Nothing happening is right. A Calculation works out a number from Numeric Facts in your book and hands it to something else. Your Reader never sees it. Nothing opens it, not even a Trigger.

It goes in any number box that offers "Calculation" next to "Number", and nearly every number box does. In a Dice Template, that is the number to beat, a Modifier, or what happens after the roll. In a Trade Screen, it is how many a Stock Change puts on the shelf. In a Combat Template, it is the number that a group's or a Combatant's rule compares against, or what happens after the combat. On a Decision Template it can set what a choice does, and on a Dialogue Template what a reply does. Under a fighter's Combat Settings, it can set a Combat Ability's damage, or their health, energy or shield. A Trigger can use it in a rule or a result. Each of these lists it under the name you gave it.

So a Calculation is built here and picked wherever the number is needed.

What do I need before this window is any use?

One Glossary Item with at least one Numeric Fact. A Glossary Item is a page for a character, place or thing. A Fact is a detail on it, added on its Fact Card. "Numeric" is the kind of Fact that holds a number, such as Dexterity: 40.

A row's "Whose number?" lists your Glossary Items. "Which number?" lists only that item's Numeric Facts. Facts of any other kind cannot be added up, so they are not offered.

What is a row, and how do I read it?

A row is a share of one number: "Take 50% of Ishmael's Dexterity". It has three picks: the percentage, whose number (a Glossary Item), and which number (one of their Numeric Facts).

Rows are added or taken off from top to bottom, and the total is the number. The "Adds up to" box under the rows reads the whole thing back as one line. Once every row is filled, it also gives today's value.

This window's own settings

What does the percentage do?

It scales that row before it joins the total. 100 uses the whole value, and 50 uses half. It takes whole numbers from 1 to 100. There is no "150%", so a number bigger than the Fact itself needs a second row or a "Multiply by" adjustment.

"Armour counts for half" is the armour row at 50% and everything else at 100.

What do "Add this row" and "Take this row off" between the rows mean?

Whether that row's share is added to everything above it, or taken off it. The first row has no sign, because there is nothing above it yet. Every row after it starts with the sign you chose when you added it. You can flip it there at any time.

Rows are worked out top to bottom, one after the other: 100% of Cold, minus 50% of Stamina, plus 10% of Luck.

What is the "then" line under a row, with "No adjustment"?

An optional fixed number applied to that row's share only, before it joins the total. The choices are "Add a fixed amount", "Subtract a fixed amount", "Multiply by" and "Divide by". "Take 100% of Morale, then subtract 1" makes Morale minus 1. "Take 50% of Strength, then multiply by 2" makes Strength again.

It runs after the percentage and touches nothing else. Multiply and divide need at least 1. A row can only ever read one Numeric Fact, never another Calculation.

How do I add or remove a row, and how many can there be?

Under the rows, "Add another row:" has two buttons. "Add" puts the new row in with a plus, and "Take off" with a minus. A Calculation holds up to 10 rows. The buttons say how many you have, and make way for a note once you reach ten.

Every row has a bin in its top-right corner. The last row cannot be removed: a Calculation with no rows is no number at all.

Can I see the number my Calculation makes?

Yes, in the "Adds up to" box under the rows. It reads the rows back as one line. Once every row has its Glossary Item and Fact, it also gives the number. That number uses the Facts' values as they stand in your book today.

While the story is read, the number follows whatever those Facts say at that moment. So the same Calculation can be 12 in one chapter and 40 in another. A Reading Simulation shows it at work.

Where is this Calculation used?

"Used by", at the bottom of the window, lists everything in your book that reads this number. It also names the part inside each one that reads it. A Dice Template, a Trade Screen, a Combat Template, a Decision Template, a Dialogue Template, a fighter and a Trigger can all appear there. The same count sits on its card in the list.

Nothing opens a Calculation and your Reader never sees one, so this is the only place its purpose shows. An empty list is not a mistake. A Calculation you have not put to work yet has nothing pointing at it. The panel then lists where a Calculation can be used.

Can a row use another Calculation, or the same Fact twice?

Rows only ever read Numeric Facts, never another Calculation. Reusing arithmetic means building it again in the second one.

The same Fact may sit in several rows. 100% of Cold on one row and 50% on another is one way to write "one and a half times Cold".

Does the name matter, and can two Calculations share one?

Only you see it, but you see it a lot. It is what you pick from the dropdown in a Dice Template, a Trade Screen, a Combat Ability or a Trigger. A name that says what the number means, such as "Frostbite risk", is the easiest to pick.

Up to 70 characters, and no two Calculations in one book may share a name, however they are capitalised. Save says so if one does.

When something looks wrong

It says the Glossary Item has no Numeric Facts yet.

That Glossary Item has no Fact that holds a number. It may have no Facts at all, or only Facts of other kinds. None of those can be added up.

A Fact added on the item's Fact Card, with its kind set to Numeric, then shows up in "Which number?". Strength, coins or a temperature would be one. A different Glossary Item that already has one works too.

It won't save.

Save names the problem. "Row 2 still needs a Glossary Item" or "still needs one of Mara's Numeric Facts" means a row is half done. Filling it, or removing it with its bin, clears that. "Give this Calculation a name" means the name box is empty. "Another Calculation is already called that" means the name is taken.

A greyed Save with "Nothing has changed since the last save" is not a refusal: there is nothing new to keep.

The card says a row reads a Fact that was deleted. What happened?

A row pointed at a Fact that has since been deleted, or whose kind was changed away from Numeric. The Calculation is marked broken in the list and in the sidebar. The book cannot be published until it is mended.

Inside, the row keeps whose number it was and shows a warning where the Fact used to be. Picking one of that item's Numeric Facts again, or removing the row, mends it once you save.

A Trigger refused my Calculation because "it would feed itself".

That Trigger result writes its answer into one of the very Facts the Calculation reads. Each time it ran it would use its own last answer, and the number would run away.

Any one of three changes fixes it. The result can write into a different Fact. The Fact it writes can be taken out of this Calculation's rows. Or the result can use a plain number instead.

What breaks if I delete a Calculation?

Whatever "Used by", at the bottom of its window, lists. The delete question shows that same list, by name. Each of those is marked broken until you point it at another Calculation or a plain number.

If the list is empty, the question says "Nothing in this book uses it.", and nothing stops working. There is no undo either way. An unused Calculation costs nothing to leave where it is.

Can I change a Calculation after it is published?

Not as it is. A published Calculation is locked, and its card in the list no longer opens. "Duplicate" makes a copy you can change. The published one changes in an Edition, started from your Published page. A Calculation can count anywhere in the story, so for a Reader already in the middle of the book, reading the changed one means starting over.