Skip to content

Set Variable

Group
Variables
In the node menu
Variables › Set Variable
Where it can be used
Scheme graphs
Tags
  • Can be folded
Presets
  • Set Clan Variable
  • Set Family Variable
  • Set Relation Variable
  • Set Scheme Variable

Set Variable writes a new value into a variable of the world, an actor, a clan, a family, a relationship or the running scheme. On a number you can also add to it, take from it or multiply it. The change stays until another node changes it again.

One node can hold several changes. They are made from top to bottom, and each one sees the ones before it.

A Set Variable of the demo scheme Season of War (Drafts/schemes/16-season-of-war.json). It takes 20 from the Treasury of the Conspirator's clan.

Use it when a variable should hold a new value from now on: a score, a flag, a choice the player made, an actor you want to remember. Put it behind a choice, a check or a wait like any other node.

Use Add Modifier instead when a number should get a bonus or a penalty that ends by itself after some days. Use Store Actor instead when you only want to keep an actor in an Actor variable of this scheme.

  • The operation counts for Integer and Float variables only. Every other kind is always set.
  • Add, Subtract and Multiply work on the stored value. What traits add on top stays a bonus.
  • For an Actor variable, an actor that is not there empties the variable. With no actor chosen, the flow stops. A clan or a family that is not there empties the variable too.
  • An Enum value the variable does not have stops the flow.
  • When one change cannot be made, the flow stops there. The changes before it stay made.
  • Actor Lists cannot be changed here. The card shows an error that names the list nodes.
  • When the next node is also a Set Variable and nothing else links to it, the card suggests Merge into One Set Variable. See Fewer nodes for the same graph.
  • The card shows the first three changes. The line with the number of the rest is a fourth line, which the card does not show: a card draws three lines at most.
LabelDraft keyTypeDefaultShown if, tooltip and notes
VariableVariableVariableRef [String, Integer, Float, Bool, Enum, Object, Actor, Clan, Family]noneThe variable to change.
OperationOperation
  • Set
  • Add
  • Subtract
  • Multiply
"Set"Set replaces the value; Add, Subtract and Multiply change the current number.
ValueValueVariableValuenot in the data

Shown if the variable is not an Actor, Clan or Family variable

The new value, or the amount for Add, Subtract and Multiply.
  • For a text variable: "The new text. Tokens such as {target.Name}, {world.Gold} or {text.key} are filled in when the node runs."
ValueActorValueActorRefnone: must be set when shown

Shown if the variable is an Actor variable

The actor the variable is set to, for example Target's heir. When that actor is not there, the variable is emptied.
ValueClanValueClanRef"of:Conspirator"

Shown if the variable is a Clan variable

The clan the variable is set to, for example Target's Clan. When there is no such clan, the variable is emptied.
ValueFamilyValueFamilyRef"of:Conspirator"

Shown if the variable is a Family variable

The family the variable is set to, for example Target's Family. When there is no such family, the variable is emptied.
draft onlyExtraChangeslist of VariableChange[]More changes, made after the first, top to bottom.
  • The Studio shows "+ Add another change" instead; with several changes, each one is a block headed "Change n" (change 1 is the node's own settings).

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

ExtraChanges (draft only): the settings of each one
LabelDraft keyTypeDefaultShown if, tooltip and notes
VariableVariableVariableRef [String, Integer, Float, Bool, Enum, Object, Actor, Clan, Family]noneThe variable to change.
OperationOperation
  • Set
  • Add
  • Subtract
  • Multiply
"Set"Set replaces the value; Add, Subtract and Multiply change the current number.
ValueValueVariableValuenot in the data

Shown if the variable is not an Actor, Clan or Family variable

The new value, or the amount for Add, Subtract and Multiply.
  • For a text variable: "The new text. Tokens such as {target.Name}, {world.Gold} or {text.key} are filled in when the node runs."
ValueActorValueActorRefnone: must be set when shown

Shown if the variable is an Actor variable

The actor the variable is set to, for example Target's heir. When that actor is not there, the variable is emptied.
ValueClanValueClanRef"of:Conspirator"

Shown if the variable is a Clan variable

The clan the variable is set to, for example Target's Clan. When there is no such clan, the variable is emptied.
ValueFamilyValueFamilyRef"of:Conspirator"

Shown if the variable is a Family variable

The family the variable is set to, for example Target's Family. When there is no such family, the variable is emptied.
  1. Out
"type"
"Set Variable"
Presets (also a "type")
  • "Set Clan Variable": sets Variable.Scope=Clan
  • "Set Family Variable": sets Variable.Scope=Family
  • "Set Relation Variable": sets Variable.Scope=Relation
  • "Set Scheme Variable": sets Variable.Scope=Scheme
"set" keys
Variable, Operation, Value, ActorValue, ClanValue, FamilyValue, ExtraChanges
"then" keys
"Out"
"<alias>": {
"type": "Set Variable",
"then": "<alias>"
}