Fields and formulas

The nine field types and their options, the whole formula engine (functions, text comparison) and how effects work.

Fields are what your sheet is made of: vigor, health, money, class, conditions… Everything else in the builder (design, combat, levels, traits) works on top of them.

Where it is

In the system builder, part Fields (also with Ctrl K: "Go to the system fields"). At the top you have Add field and Add folder, the search box (Search fields) and the List / Table switch. Each field is edited in the side panel that opens when you press it.

Requirements and permissions

The system's owner and its co-editors edit it. Changes save by themselves and Undo walks back through them.


Label and key

Each field has two names:

  • Label: what the player reads, e.g. Vigor.
  • Key: the internal name, e.g. vigor. Formulas, effects, combat and sheet-workers use the key.

Changing the label breaks nothing. Changing the key does not either: everything that named it (formulas, sheet blocks in any design, effects, combat, states, creation, levels, automations, group sheets, inventory) moves to the new key at that moment, and a notice with Undo says how many references were updated. Free text (descriptions, notes) is left alone, except what goes between {{ }}. Choose short keys, in lowercase and without accents.


The nine types

TypeWhat it is for
NumberAttributes, skills, values. The most common type
CounterUses, charges, ammo. The player raises and lowers it live
CalculationCalculated by a formula. Updates automatically, not typed by hand
TextName, background, descriptions
Yes or noA switch that can apply effects while it is on
ChoiceClosed options. Can be the character's class or archetype
ResourceHealth, mana, willpower: a bar with its maximum
Box trackBoxes that get marked: morale, wounds
TagsFree tags: conditions, traumas, loose statuses

In the field's panel you choose the Type, the Starting value and whether it Can be rolled. Further down, Advanced gathers the less common settings (Where it shows: Hidden in creation and Hidden in the summary), and Data (JSON) lets you write the whole field by hand.

In Where it shows you can also see and change where the field goes on the sheet without leaving the panel: the Sheet tab, the Width on desktop and the Width on phone; See it on the sheet opens Layout.

Rollable

The Can be rolled switch makes the field rollable: it appears as a button on the sheet and uses the system's die. It is not available on Yes/No, Text, Counter or List, since rolling them would make no sense.


Options by type

Number and Counter

  • Fixed Minimum / Maximum.
  • Min by formula / Max by formula: the limit is recalculated live. For example 3 + aguante means "vigor cannot go past 3 plus your stamina".

Things to keep in mind:

  • The formula limit clips what is typed on the sheet and in creation.
  • It is available in other formulas as <key>_min and <key>_max.
  • Effects and bonuses are not clipped: a perk can take you above the maximum.

Shown as → Die (d4…d12): for games where the trait is a die (a d4 to d12 trait). The field stores the faces (4, 6, 8, 10, 12; 0 is untrained and 13 is d12+1) and the sheet draws it as a die with its own silhouette. The buttons step up and down one die at a time, and so does the upgrade shop. Formulas still read the number (pelear / 2). Untrained (value 0) is the label shown at 0, for example d4−2.

Derived

You write its formula and the value is calculated automatically. It cannot be edited by hand.

FLOOR((vigor - 10) / 2)

Use derived fields for modifiers, totals and combat values. If you're asking the player to type a number that could be calculated, make it derived.

Select

  • Options: the closed list of values.
  • Options from a database: instead of typing them, the options are the entries of one of the system's databases (for example the species of a catalog of creatures) and they update when the database grows. With many options, the sheet and the creation wizard show a search box.
  • Options = sheet fields: the player picks one of the fields you tick ("which field do you roll with?": Vigor, Cunning…). To use the chosen field's value, write CAMPO(elegido) in a derived field, a roll, a block or a visibility condition.
  • Effects per option: when that option is chosen its effects apply. This is how classes are built: Warrior adds +2 to vigor, Mage adds +2 to mana.
  • Help per option: a descriptive text shown when choosing each option (what that class does, what that background means).
  • Pickable category with effects: marks the field as the character's class. Other parts of the builder (per-class designs, trees, progression) use it as a reference.

Several pickable categories (lineage, trade, class...)

"Class" is just the name of the switch: it works for any category the character picks that changes what they get. Create one select field per category ("Lineage", "Trade", "Class"... whatever you like), turn on Pickable category with effects on each and write its options. You can tick as many as you need and the creation wizard asks for one option from each.

Each option carries its own: help, icon or art, effects (bonuses, gifts) and, in Creation and progression, grants and traits for that option only. All categories count at once, so a trait restricted to "Elf" shows up whatever the trade is. If a category depends on another (subclasses), turn on Is subclass and say which one it hangs from.

  • Purchasable upgrade: locks the select in play so it can only be raised by spending experience, with the cost you define per step.

Yes / No

A toggle. It can carry effects that apply while it is on: Heavy armor → −2 to stealth while it is worn.

Resource (current / maximum)

Stores a current value and a maximum. The maximum can be fixed or by formula (fisico + 6). On the sheet it is drawn as a bar, and the player spends and recovers it without entering edit mode.

The maximum is available in formulas as <key>_max.

Boxes (track)

Like a resource, but as clickable pips: you define how many boxes there are (fixed or by formula) and the player marks them.

Damage types and levels (optional). Sometimes a box doesn't always mean the same thing. Health in some games is marked in three ways (a bruise, a cut and a burn don't heal the same way), and each level takes dice away from all your rolls. With Damage types and levels the track handles this automatically, including the parts players tend to forget:

  • Sorts by severity. If you have two bruises and get stabbed, the serious wound goes to the top and the bruises move down. This matters because the penalty comes from the deepest box.
  • Applies the penalty. You give each box a name and a number ("Wounded −2") and the sheet shows the current level at the top. In formulas it's <key>_penalty, and it is negative, so a pool is written astucia + pelea + salud_penalty. When wounded, you roll fewer dice automatically.
  • Upgrades the type of what overflows. For example, bashing damage that doesn't fit becomes lethal. The engine applies this and tells you, since it's the rule that turns a beating into a real wound.

A button builds the whole tiered health (seven boxes, three types and their penalty levels). Leave the block empty and the track works as usual.

In play, the player picks the type at the top and marks boxes; clicking a marked box heals it. If an attack from the map targets this field, the attack's damage type decides which one to mark.

List / tags

A list of free texts the player adds and removes. For conditions or statuses that don't need a field of their own.

With Preset tags you offer a list of options that are chosen when creating the character. If the skills are long and take up a lot of room, turn on Hide unchosen ones on the sheet: the sheet shows only the chosen ones and a button to see the rest when the player wants to add another.

Main ability

On numeric fields you can turn on Main field: the sheet marks it with a diamond next to its name so newcomers know where to spend their points. If the system has classes, you can say which ones it is main for ("Vigor" for Fighter, "Cunning" for Wizard); without that list it is main for everyone.


Formulas

Formulas are written like in a spreadsheet and evaluated by our own safe engine (it doesn't run code; it is an interpreter with an allowlist).

Syntax

  • Numbers and quoted text: 'ligera' or "ligera".
  • Operators: + - * / % and parentheses.
  • Comparators: < <= > >= == !=.
  • Logic: AND / OR / NOT (also &&, ||, !).
  • Ternary: condition ? ifTrue : ifFalse.
  • References: the name (the key) of any field.

Note that == and != compare as text if either side is not a number, so you can write conditions on choices:

IF(clase == 'mago', instinto, vigor)
IF(arma == 'espada', 2, 0)

Functions

FunctionWhat it does
IF(cond, ifTrue, ifFalse)One value or the other. IF(vigor > 50, 2, 1)
IFS(c1, v1, c2, v2, …, default)Several chained conditions; the final loose value is the default. IFS(vida <= 0, 0, vida < 5, 1, 2)
MIN(a, b, …)The smallest. MIN(astucia, 80)
MAX(a, b, …)The largest. MAX(1, vigor - 10)
FLOOR(x)Rounds down. FLOOR(astucia / 2)
CEIL(x)Rounds up
ROUND(x)Rounds to the nearest integer
ABS(x)Absolute value
CLAMP(x, min, max)Limits x between min and max. CLAMP(vida, 0, vida_max)
AND(a, b, …)True if all are met
OR(a, b, …)True if any is met
NOT(a)Inverts a condition
XOR(a, b, …)Holds only if exactly one holds
BETWEEN(x, min, max)Holds if x is between min and max (inclusive)
SUM(a, b, …)Sum
AVG(a, b, …)Average
LOOKUP(database, name, field)Value of a field of an entry in a database of the system, looked up by name. LOOKUP('criaturas', especie, 'atk')
CATALOG_COUNT(database)How many entries a database has. CATALOG_COUNT('criaturas')
CATALOG_SUM(database, field)Sum of a field across all entries of a database. CATALOG_SUM('objetos', 'peso')
HAS_PERK('key', …)1 if the character has any of those perks, 0 otherwise. Lets a creation step appear depending on an earlier choice: HAS_PERK('origen_justiciero')
CAMPO(name)The value of the field with that name, by its visible name or its key. With a field selector: CAMPO(elegido) → the value of the chosen field
POW(base, exponent) · SQRT(x) · MROUND(x, multiple)Power, square root and rounding to a multiple. MROUND(peso, 5)
COUNT(list)How many items a list has. COUNT(LOOKUP('criaturas', especie, 'movimientos'))
INCLUDES(list, value)1 if the list contains that value (ignoring case and accents). INCLUDES(LOOKUP('criaturas', especie, 'tipos'), 'Fuego')
INDEX(list, n)Item n, starting at 1. INDEX(LOOKUP('criaturas', especie, 'tipos'), 2)
JOIN(list, separator)Joins a list into text. JOIN(LOOKUP('criaturas', especie, 'movimientos.[].nombre'), ' / ')
FILTER(list, field, value)The items whose field equals that. COUNT(FILTER(LOOKUP('criaturas', especie, 'movimientos'), 'tipo', 'Fuego'))
CONCAT(a, b, …) · LEN(x) · CONTAINS(text, piece)Joins texts, measures a text or a list, and looks for a piece (ignoring case and accents). CONCAT(nombre, ' the ', apodo)
UPPER(x) · LOWER(x) · TEXT(x, decimals) · SIGNED(x)Upper case, lower case, number with decimals, and number with its sign to show modifiers ("+3").
COUNT_PERKS('category')How many perks of that category the character has (or of those starting like it: 'Arte' counts 'Arte · básicas'). COUNT_PERKS('Bendición') < 5

Calculations with databases: LOOKUP, CATALOG_COUNT and CATALOG_SUM read the system's databases (the roster widget's datasets; see the Design → Roster and databases guide). The second argument of LOOKUP is usually a sheet field that stores the entry's name (for example an especie select). If the system doesn't have that database, they return 0.

Text from the database: LOOKUP also returns text. A Derived field with LOOKUP('criaturas', especie, 'tipo') shows "Fire", and a text block can mix it in: Type: {{LOOKUP('criaturas', especie, 'tipo')}} · ATK {{LOOKUP('criaturas', especie, 'atk')}}. So any widget or part of the sheet can show any column you want from the chosen entry.

Lists and objects inside a database (common when importing a JSON: a species' evolutions are a list, its height an object with feet and metres) show as readable text, and in the database editor you click them to edit them as JSON. To pick out a piece, the column accepts a path: LOOKUP('criaturas', especie, 'altura.metros'). A text block can also loop through a list and read each item: {{#each LOOKUP('criaturas', especie, 'movimientos')}}- {{this.nombre}} ({{this.rango}}){{/each}}. A number goes into ONE element ('movimientos.0.nombre', the first) and [] into all of them: LOOKUP('criaturas', especie, 'movimientos.[].nombre') is the list of every name ("Charge, Roar…").

They work in all formulas: derived fields, formula limits, effects and also those of a roll (the threshold, the bonus, how many dice are rolled, how many each dice group contributes and the condition of a post-roll decision). Mind the shape of the data: an entry's values live inside its columns, so the third argument is the name of the column of the database.

An example, where the weapon's dice come from its database and are drawn in its color:

LOOKUP('armas', arma, 'dados')      → how many dice the weapon group contributes
LOOKUP('armas', arma, 'bono')       → what it adds to the total

There is also the special variable field_value: in roll thresholds it means "the value of the field itself".

Examples

FLOOR((vigor - 10) / 2)           Classic modifier
aguante + nivel * 2               Health per level
CLAMP(vida, 0, vida_max)          Never below 0 nor above the maximum
IF(clase == 'mago', 3, 1)         Depends on the class
MAX(astucia, instinto)            The better of two
IFS(nivel >= 10, 4, nivel >= 5, 2, 1)   Step by level

Under every formula in the creator there are Ready-made examples: IF with a checkbox, bands with IFS, conditions with AND/OR, dice that depend on several checkboxes, LOOKUP in a catalog (one value, a list with lista.[].Nombre, a sum). They are built with your system's fields and one click puts them in the formula: if it was empty they replace it, if it already had something they go at the cursor.

While you type. As you type a name, the fields and functions that match appear (up and down to choose, Enter or Tab to accept, Esc to close). If the formula is not understood or names a field that does not exist, the warning appears right below ("Unknown field"), and with the field's sample value you see the result (= sample value). The "Ready-made examples" blocks above go in at the cursor.

Custom functions. In the Functions part you give a name and parameters to a formula you repeat, e.g. BONUS(x) = FLOOR((x - 10) / 2), and use it in any formula of the system: BONUS(vigor) + 2. It appears in the suggestions as you type and in the System map. Change its body and every formula that uses it changes. Its parameters only exist inside it, even if they share a field's name.

If a formula references a field that doesn't exist, that slot is worth 0 (it doesn't break the sheet). The editor shows a preview of the result as you type.


Effects

An effect changes the value of another field. Operations:

OperationWhat it doesExample
Add +Adds (or subtracts with negatives)+2 to Vigor
Subtract −Takes away−2 to Cunning while poisoned
Set =Imposes a valueSpeed = 0 while grappled
Multiply ×MultipliesSpeed ×0.5 in heavy armor
At least ≥Keeps the higher of the twoNatural armor: defense at least 13
At most ≤Keeps the lower of the twoExhausted: Speed at most 10

They can be applied to fields of type Number, Derived and Counter. Resources and Boxes offer two targets: their (current) value and their (maximum), so you can raise the health maximum without touching current health.

Where they hook in

Effects appear in several places in the builder, always with the same editor:

WhereWhen it applies
Yes/No fieldWhile the toggle is on
Option of a selectWhile that option is chosen (classes, backgrounds)
PerksWhile you have the perk
TreesWhen you unlock that level of the branch
LevelsWhen you reach the level
Combat / statusesWhile the condition lasts

Since effects stack on the base value, the order is: field value → effects → derived formulas that use it.

Advanced: when, in what order and what stacks

The sliders button next to each effect's bin opens four more settings. If you leave them alone, the effect works exactly as before:

SettingWhat for
Only ifA formula: the effect only counts while it holds (rage > 0, vida < 5)
PriorityThe order. Lowest goes first: multiply 10, add, subtract and set 20, at most 30, at least 40. A «set» at 50 goes after everything and nothing moves it
When it appliesLast applies the effect on top of computed values, derived ones included: «your Defense is at least 15» even when it comes from a formula
Does not stack withA group name. Among effects in the same group on the same field only the highest counts: two shields don't add up, the best one does

Effects on one sheet

What happens to a character during play (a spell cast on them, a wound, a blessing) does not belong to the system. The GM records it in that sheet's effects panel (see Players, roles and teams): name, effects and, optionally, how many rounds it lasts. It can be switched off without deleting it, rounds pass with the − button and, at zero, it stops counting.

Automations: when, if, then

In the Automations part you program the sheet without code, as a List or as Nodes (like Unreal's Blueprints), and also as cables. The views edit the same rules: what you change in one shows up in the others. Each rule has three parts:

PartWhat goes in
WhenA field changes, goes up or goes down · on roll (one field or any; the formula sees tirada_total) · on rest · on gaining a perk · on level up · on character creation · with a button on the sheet · any change
IfA condition: compare fields and values, and, or, not, has the perk
ThenAdd, subtract or set a value · roll dice and add or set the result · notify (with {{formula}} inside) · activate or remove an effect · give or remove a perk · if / else · repeat · store a named value

Test the rule runs the rules on a test sheet and marks which ones fire. They run on the sheet of whoever makes the change, so an "add" is not applied twice even if the GM and the player both have the sheet open. One rule can trigger another; if they trigger each other in a loop they stop by themselves after a few turns.

You can move between views without worry: what a rule stores (asking for a roll with its difficulty and note, the roll's name, advantage or resistance effects) is kept in every view. In the List, each trigger carries its icon and the row's internal code becomes a hint. Long help shows on hover, on focus or with a long press; and when you type a formula, a condition, text with {{ }} or a path, the creator suggests fields, functions and names, and warns when a key does not exist.

In the code view, a rule can be written with every trigger: alGanarPerk, alPulsarBoton and alSiempre, besides the field, roll, rest and level ones. ctx.activa(false) stores the rule disabled, like its "Active" box in the List, and every trigger and action has its help in the code reference.

Advantage and disadvantage (altered states)

Sometimes an effect shouldn't change a number but how you roll. The "Add advantage/disadvantage" button handles this, with three scopes:

ScopeWhat for
Everything governed by \<field\>The usual case for altered states: Exhausted puts every Vigor skill at disadvantage, and Cunning or Instinct skills are unaffected
One skillOnly that roll
All rollsNo distinction

The middle one saves the most work, and it needs some setup: in each skill's panel, set "Governing field". That tag changes nothing on its own. It lets a state say "disadvantage on everything governed by Vigor" in one line instead of listing Crafting, Swords, Axes, Spears… one by one. You set it once and it works for every state you add later.

Two things to know:

  • They stack. Exhausted + Sick on the same field are two disadvantages (you roll three dice and keep the worst), not one.
  • Advantage and disadvantage cancel out: if a state gives you disadvantage on Vigor and a perk gives you advantage on Swords, on Swords you roll normally.

Advantage means rolling more dice and keeping the best, not a +2. In pool systems (counting successes) it does not apply: there, more dice mean more successes, and keeping only one would throw away what you rolled.


List and table

List shows each field as a row; Table shows them all in a grid with label, key, type and value. To move fields in bulk, Select marks several and you can Move to folder, duplicate or delete them at once. With filters on (by type or folder) you cannot reorder. Import JSON brings in fields from a file; "Copy the system as JSON" puts the whole system on the clipboard.

The table is a spreadsheet: every cell is editable (arrows, Enter, Tab and Esc), Ctrl+C copies the range, Ctrl+V pastes a block from a sheet (creating the rows that are missing) and Ctrl+D fills down. With fields selected, Change… changes type, rollable, folder, limits or visibility for all of them, and Apply formula… sets a formula on each or creates a derived field for each with a wildcard for its key and label. “Several…” in the add menu creates a typed or pasted list of fields at once (one per line, comma-separated, or pasted from a sheet with name, initial value, minimum and maximum columns; before creating you see the names and keys that will result, and it is a single Undo step). The same works in the lists of traits, states, rests, coins and tables; more on creating without leaving the section in System Builder: first steps. “Duplicate several times…” copies a field with new names and variations.

From another virtual table. Import JSON also understands the template.json of a Foundry VTT system: the character actor type becomes fields (one folder per block; { value, max } is a resource) and each item type becomes an empty database with its columns. Formulas and rules are not in that file: you add them afterwards.

Groups (folders)

You can group fields in folders to keep things manageable as the system grows, and nest them one level deep. This only organizes the editor: the sheet layout comes from the Design, not from the order of this list.


Common mistakes

"I changed the key and something still points to the old one" This only happens with what is not system data: code you wrote (workers, scripts) or free text. Find it and change it by hand; the Review tells you what is left dangling.

"My derived field does not change" Check that the formula references keys and not labels: vigor, not Vigor (if the key is in lowercase).

"The max by formula will not let me go up with a perk" Limits clip what is typed, but effects can go past them. If your perk raises nothing, check that the effect targets the right destination ((maximum) and not (current)).

"An Edge lets a trait go above d12" Give the trait a max by formula (12 + tope_disparar) and have the Edge add to that counter. Advances and creation respect the formula cap, not just the fixed one.

"One language per row, each with its own die" Mark the skill as specializable: the player adds named rows and, if the field is a die, each row has its own die with steps. For each row to roll its own die, write the roll formulas with field_value instead of the field key.

"I want the player not to be able to touch this number" Make it Derived: it is calculated automatically and is not editable.


Next step

With the fields defined, the next step is placing them: continue with the Sheet design guide.


See also

System Builder: first steps, Sheet layout, Rolls, Combat, Code mode (Roll20 style).

All Roliando guides