Compare Variable
Compare Variable
True
False
- Group
- Variables
- In the node menu
- Variables › Compare Variable
- Where it can be used
- Scheme graphs
- Tags
- Presets
What it does
Section titled “What it does”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.
Example
Section titled “Example”Compare Variable
Clan of Conspirator: Treasury ≤ 0
True
False
When to use it
Section titled “When to use it”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.
Good to know
Section titled “Good to know”- 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.
Settings
Section titled “Settings”| Label | Draft key | Type | Default | Shown if, tooltip and notes |
|---|---|---|---|---|
| Variable | Variable | VariableRef [String, Integer, Float, Bool, Enum, Object] | none | The variable to compare. |
| Comparison | Op |
| "=" | |
| Value | Value | VariableValue | not in the data | The value the variable is compared with. Text is compared exactly: upper and lower case count ("Duke" is not "duke"). |
| Compare With | CompareWith |
| "Value" | Compare with a value written here, or with another variable. |
| Other Variable | OtherVariable | VariableRef [String, Integer, Float, Bool, Enum, Object] | none | The variable to compare with. |
| Check | LevelTest |
| "Value" | Compare the value, or test the named level it is at (Integer and Float variables with levels). |
| Level | Level | text | "" | The level the value is tested against. |
| draft only | Negate | bool | false |
|
| draft only | ExtraConditions | rows of ConditionData | not in the data |
|
Draft only: a draft sets it; the Studio has no row of its own for it.
Outputs
Section titled “Outputs”- True
- False
In a draft
Section titled “In a draft”"type""Compare Variable"- Presets (also a
"type") "Compare Clan Variable": setsVariable.Scope=Clan"Compare Family Variable": setsVariable.Scope=Family"Compare Relation Variable": setsVariable.Scope=Relation"Compare Scheme Variable": setsVariable.Scope=Scheme
"set"keysVariable,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>" }}