Skip to content

Behaviour: Formulas

A formula is a number with a name, worked out from the world: “Fear of someone”, or the “Strength” of a clan. You write it once. Wants, nodes and texts then read it by its name, and a text can print it as {formula.Name}.

A scheme can name a formula as its chance of success, as Scheme settings shows. Background is on Characters that think.

  • Several decisions or nodes need the same number.
  • A scheme’s Chance of success or Risk of being found out needs a formula to pick.
  • You want to see which formulas nothing uses.

Choose Behaviour in the Page menu, then the Formulas tab. No figure is drawn. It is a list page: a table, with the Element Inspector at the side.

The table header has the title Formulas, a count, a search field (hover text Find formulas by name), a ⋮ menu (More actions) and New. A search that hides rows shows the count as 3 of 7. The columns are Name, About, Reads as and Used By; a click on a title sorts. A dot before a name marks a problem.

With no formulas the table says No formulas yet and Create a formula with New. A formula is a number worked out from the world, such as Fear of someone., with a New Formula button. A search with no hit says No matches.

With nothing selected, the inspector shows a count such as 3 formulas, 1 with problems. Select one to edit it. and a Forecast what characters would do button, which opens Behaviour: Simulation. New is grey in Play mode.

  1. Click New. A formula called New Formula is added and selected, and the cursor goes to its name field in the inspector.
  2. Type a Name. The hover text says that wants, nodes and texts pick the formula by this name. Write a Description if you like: it is shown in pickers.
  3. Choose It is about: One character, Two characters, One clan, Two clans or The world.
  4. In The number, set Starts at. A formula may be negative. Click + Add line ▾ for a line that changes the number when its conditions hold. Each line has When, Then (More, Less, Times, Does not want this) and an optional Call it. Lines are the same control a decision’s want uses: see Behaviour: Decisions.
  5. To add a whole group to the number, use Add Up Over A Group. A group has Among, Who, Each counts as (hidden for Count them) and Then: Add them up, Count them, The highest, The lowest or The average.
  6. Choose Show as: A number or A percent.

Under Try it, pick For, and Toward for a formula about two, to see the value for real characters. It reads the database and never changes it.

To undo, use Undo in Unity’s Edit menu. Every edit is one step.

Right-click a row for Duplicate or Delete…. The same two are in ⋮ as Duplicate Selected and Delete Selected…. Cmd/Ctrl + D duplicates, and Delete deletes. A copy is named like the original plus Copy, and it is a new formula with its own ID, so deleting the copy never touches the first one. The dialog Delete Formula says where the formula is used, or Nothing refers to it.

A formula does nothing alone. Its worth is the places that read it, and the inspector’s Used By list, with a Go there button on each place, shows them all, so you can tell at a glance whether a formula still earns its row. Decisions, ambitions and clan strategy read formulas: Behaviour: Decisions, Behaviour: Ambitions, Behaviour: Clan Strategy. Clan formulas are read through the clan’s head or highest-ranking member.

Setting What it does Default
It is about Who the number is worked out for. One character
Starts at The number before any line is looked at. 0
Show as How the number is written where a person reads it. A number
Message What to do
The formula has no name. Type a name.
Another formula is also called “…”. Rename one of them.
This formula reads itself for the same characters: where it does, the repeat gives nothing. Read it for another character (their father, the clan head) or use another formula. Change what the formula reads.

A formula that reads itself for other characters shows an information line, not a problem: It reads itself for other characters (their father, the clan head): that works, down to 8 formulas deep. After a delete, wants and nodes that read the formula show a “missing formula” error and do nothing until you pick another.