Skip to content

Compare Variable

Group
Variables
In the node menu
Variables › Compare Variable
Where it can be used
Scheme graphs
Tags
  • Also a condition row: Variable
Presets
  • Compare Clan Variable
  • Compare Family Variable
  • Compare Relation Variable
  • Compare Scheme Variable

Compare Variable asks one question about a variable and sends the story down True or False. You compare it with a value you write, or with another variable. The variable can belong to the world, an actor, a clan, a family, a relationship or the running scheme.

For a number with named levels you can test the level instead of the value.

A Compare Variable of the demo scheme Season of War (Drafts/schemes/16-season-of-war.json).

Use it for one yes-or-no question, or for a range such as at least or below.

Use Branch By Value instead when a chain of these nodes asks about the same variable again and again. Use Compare Numbers instead when the number is a formula, an age or a count rather than a variable.

  • Text is compared exactly. Upper and lower case count.
  • Text, Bool, Enum and Asset (Object) variables take = and ≠ only. Another comparison shows an error on the card.
  • When the variable or its owner is not there, the check has no answer and the flow stops at the node.
  • A check never creates a relationship. A relationship that was never written is read from its defaults.
  • When the owner is the Target and the scheme runs without one, the check has no answer and the flow stops at the node.
  • The node can hold more conditions with + Add another check. They are joined by AND or OR, and each can be turned around with NOT.
LabelDraft keyTypeDefaultShown if, tooltip and notes
VariableVariableVariableRef [String, Integer, Float, Bool, Enum, Object]noneThe variable to compare.
ComparisonOp
  • Equal (= Equal)
  • NotEqual (≠ Not Equal)
  • Greater (> Greater)
  • Less (< Less)
  • GreaterOrEqual (≥ Greater or Equal)
  • LessOrEqual (≤ Less or Equal)
"="
ValueValueVariableValuenot in the dataThe value the variable is compared with. Text is compared exactly: upper and lower case count ("Duke" is not "duke").
Compare WithCompareWith
  • Value (A value)
  • Variable (Another variable)
"Value"Compare with a value written here, or with another variable.
Other VariableOtherVariableVariableRef [String, Integer, Float, Bool, Enum, Object]noneThe variable to compare with.
CheckLevelTest
  • Value (The value)
  • AtLevel (Is at level)
  • AtLeastLevel (Is at least level)
  • BelowLevel (Is below level)
"Value"Compare the value, or test the named level it is at (Integer and Float variables with levels).
LevelLeveltext""The level the value is tested against.
draft onlyNegateboolfalse
  • Every condition node has this setting.
  • The Studio shows the NOT mark on a condition's heading line instead, once the node has more than one condition.
draft onlyExtraConditionsrows of ConditionDatanot in the data
  • Every condition node has this setting.
  • The Studio shows "+ Add another check" under the node's own rows instead; each further condition gets a heading line (IF / AND / OR, NOT).

Draft only: a draft sets it; the Studio has no row of its own for it.

  1. True
  2. False
"type"
"Compare Variable"
Presets (also a "type")
  • "Compare Clan Variable": sets Variable.Scope=Clan
  • "Compare Family Variable": sets Variable.Scope=Family
  • "Compare Relation Variable": sets Variable.Scope=Relation
  • "Compare Scheme Variable": sets Variable.Scope=Scheme
"set" keys
Variable, Op, Value, CompareWith, OtherVariable, LevelTest, Level, Negate, ExtraConditions
"then" keys
"True", "False"
As a condition row
"kind": "Variable"
"<alias>": {
"type": "Compare Variable",
"then": { "True": "<alias>", "False": "<alias>" }
}