Skip to content

Tutorial 3: Gold and words

In Tutorial 1 the coins lived in the scheme. Now every actor gets a purse of its own, called Gold. You read it in a check, spend it, print it in the dialogue and show it in the objective. The scheme from Tutorial 1 is the one you change.

A variable has an owner. You pick it once, and it decides who holds a value.

Owner One value for Use it for
Each Actor Each actor A purse, a health, a mood.
This Scheme Each run of one scheme What only this plot needs, like Coins.
World The whole game A year counter.

This Scheme variables are made in the Library of a scheme, as in Tutorial 1. Belongs To on the Variables page offers the others: Each Actor, Each Relationship, Each Clan, Each Family and World.

Gold is for every actor, so it belongs to Each Actor. See Variables.

  1. In the page menu, choose Variables. Click New.
  2. Type Gold and press Return. Names take letters and digits only.
  3. In the inspector, check that Type reads Integer and Belongs To reads Each Actor. A new variable starts that way.
  4. Under Limits, turn on Minimum, and set Lowest to 0.
  5. Under Default Value, leave the value at 0.

You should see a row Gold, Integer, Each Actor, with the default 0. See Variables page.

  1. In the page menu, choose Actors. Select your conspirator on the People tab.
  2. Find Starting values. Set Gold to 40.

Dimmed values are the variable’s default, so Gold should stop being dimmed. Starting values are what the actor starts a new game with. See Actors: People.

  1. Open A Cup for the King. Select the Compare Variable node.
  2. Click the button of Variable. In Which variable?, click Gold under EACH ACTOR.
  3. An Actor row appears. Make sure it is Conspirator.
  4. Select the Set Variable line under True. Do the same: Gold, Actor Conspirator, Operation Subtract, Value 15.

The cards should read Conspirator: Gold ≥ 15 and Conspirator: Gold − 15. The scheme’s own Coins is not used now. Delete its row in the Scheme tab of the Library, with the button with the cross.

Select the Show Dialogue node and replace its Text with this:

{target.Name} dines alone tonight, and Torsten carries the cup. You hold {conspirator.Gold} gold.{if conspirator.Gold >= 15} Torsten could be bought.{else} Torsten will not be bought with so little.{end}

A token is a subject, a dot and a member in braces. {target.Name} is the target’s name and {conspirator.Gold} is the conspirator’s own Gold. The {if} block shows its words only when the condition holds, and {end} closes it. See Texts, tokens and pacing.

A token that names nothing, such as a typo, is printed as you wrote it. The Studio checks texts and suggests the word you meant.

  1. Under Choices, click Bribe Torsten.
  2. In Available when, write conspirator.Gold >= 15.
  3. In Tooltip when unavailable, write You need at least 15 gold.

Tooltip when unavailable appears once Available when holds a condition. The condition has no braces, because it is a condition, not a text. While it fails, the choice is greyed out and the tooltip says why.

  1. Drag from the output of Start and add Set Objective. It folds under Start.
  2. In Objective, write Poison {target.Name}. You hold {conspirator.Gold} gold.

The line under Start should read as your objective. The tokens are filled in whenever the objective is shown, so the number stays current. See Set Objective.

Save with Cmd+S (Ctrl+S on Windows).

Run the scheme with setup. Choose the conspirator you gave 40 gold.

  • The dialogue should say you hold 40 gold and that Torsten could be bought. Bribe Torsten is on.
  • The Values section of the Run tab should list the Objective, with its text.
  • Set the conspirator’s starting Gold to 10 and run again. The {else} sentence should show, and Bribe Torsten should be off, with a hover text that starts Not available now.

The test run works on a copy, so the 15 gold you spend is never taken from your database. The run starts each actor with its Starting values. See Test run.

  • The text shows braces. A token has a typo, or the member is not one the subject has. Compare the words with the table in the texts page.
  • A choice is always on. Available when is empty, or it has a condition that is always true.
  • Gold is not under EACH ACTOR in the picker. The picker groups variables by owner. Set Belongs To to Each Actor on the Variables page.