Set Variable
- Group
- Variables
- In the node menu
- Variables › Set Variable
- Where it can be used
- Scheme graphs
- Tags
- Presets
What it does
Section titled “What it does”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.
Example
Section titled “Example”When to use it
Section titled “When to use it”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.
Good to know
Section titled “Good to know”- 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.
Settings
Section titled “Settings”| Label | Draft key | Type | Default | Shown if, tooltip and notes |
|---|---|---|---|---|
| Variable | Variable | VariableRef [String, Integer, Float, Bool, Enum, Object, Actor, Clan, Family] | none | The variable to change. |
| Operation | Operation |
| "Set" | Set replaces the value; Add, Subtract and Multiply change the current number. |
| Value | Value | VariableValue | not 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.
|
| Value | ActorValue | ActorRef | none: 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. |
| Value | ClanValue | ClanRef | "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. |
| Value | FamilyValue | FamilyRef | "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 only | ExtraChanges | list of VariableChange | [] | More changes, made after the first, top to bottom.
|
Draft only: a draft sets it; the Studio has no row of its own for it.
ExtraChanges (draft only): the settings of each one
| Label | Draft key | Type | Default | Shown if, tooltip and notes |
|---|---|---|---|---|
| Variable | Variable | VariableRef [String, Integer, Float, Bool, Enum, Object, Actor, Clan, Family] | none | The variable to change. |
| Operation | Operation |
| "Set" | Set replaces the value; Add, Subtract and Multiply change the current number. |
| Value | Value | VariableValue | not 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.
|
| Value | ActorValue | ActorRef | none: 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. |
| Value | ClanValue | ClanRef | "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. |
| Value | FamilyValue | FamilyRef | "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. |
Outputs
Section titled “Outputs”- Out
In a draft
Section titled “In a draft”"type""Set Variable"- Presets (also a
"type") "Set Clan Variable": setsVariable.Scope=Clan"Set Family Variable": setsVariable.Scope=Family"Set Relation Variable": setsVariable.Scope=Relation"Set Scheme Variable": setsVariable.Scope=Scheme
"set"keysVariable,Operation,Value,ActorValue,ClanValue,FamilyValue,ExtraChanges"then"keys"Out"
"<alias>": { "type": "Set Variable", "then": "<alias>"}