Variables and unlocks
Variables
A variable is something the game remembers: a number like courage, a yes or no like met the fisherman, or a word like the player’s name.
Change one in the story
On a new line, type:
> courage + 1
> courage = 3
A name the game doesn’t have yet becomes a new variable. In the file, it is a Chatterbox <<set>>:
<<set $courage to $courage + 1>>
<<set $courage to 3>>
In Chatterbox, variable names start with $. Later you can check a variable with an If (Conditions), or show it in a line with {$courage}.
Variable names are one word. Type rice bowls and Tsumugi names it riceBowls, or in the style your game already uses.
The Variables tab
The Variables tab lists what the game remembers.
- Add a variable: type a name, what it Starts at, and What is it for?, then click Add.
- Never used: variables and functions no line uses. Each has Remove when it is safe to remove.
- Story variables: each variable, how often the story uses it, its starting value and its note. Change a value or a note, then press Enter or click away to save it.
- Set elsewhere: variables your game’s code sets up. You can see them here, and change them in GameMaker.
Remove shows only when nothing uses the variable.
Where starting values live
Tsumugi keeps the starting value of each story variable in a script it writes in your game. Your game’s code can set up its own variables too, with Chatterbox. Tsumugi reads both.
Tsumugi flags a variable the story uses with no starting value. Add one in the Variables tab.
Unlocks
Unlocks are skills, abilities and achievements the player earns. They have their own tab once your game has one. Until then, the tab is under More (⋯).
Add an unlock
Click + New skill (or ability, or achievement) and fill in:
- Name, and Used in dialogue as: the name the story uses.
- Description.
- Hidden until unlocked, for secrets.
- An icon: a placeholder for your artist, your own picture, or none.
Give it
An unlock can be given two ways:
- By the story. Type
> unlock Bravewhere the player earns it. - By itself. Under Unlocks by itself when…, add conditions, like courage at least 2 and has the Fish. Reads as says it in words.
Each unlock says where it is given, or Not given anywhere yet.
In your game
Tsumugi writes the unlocks into a script in your game, with functions to give and check them. It also adds an empty function your game calls when the player unlocks something, so a programmer can show it. Until then, it shows as needs code.