Events
An event is something the game does when the story reaches a line: change the background, give the player an item, play a sound, show a place on the map, unlock a skill, or move to another node.
You write events in plain words. Tsumugi turns each one into the Chatterbox command your game runs, and shows it as a tag.
Add an event
Type > at the start of a new line. A menu lists every event your game has. Pick one, then pick the rest, like the item or the area.
> gets Onigiri
Press Enter. The line turns into a tag, like Gets Onigiri. Click any tag to change it.
Other ways to start one:
- Click Insert Event at the end of the line you are writing.
- Press ⌥ / (Insert Event).
- At the end of a line of text or an option, type a space,
>and the event. Press Enter and Tsumugi moves the event to its own line. - Know Chatterbox? Type
<<at the start of a line to pick the same events as commands.
As you type, the events you have already used in the file come first, under Used before.
Warning
A line that starts with > and is not yet an event is shown as broken. Press Enter to finish it, pick one from the menu, or take the > away.
Everyday words
You don’t have to remember the exact words. These mean the same:
| You type | It means |
|---|---|
> go to Harbour |
> jump to Harbour |
> go back |
> hop back |
> courage +1 |
> add 1 to courage |
> courage = 5 |
> set courage to 5 |
> give Fish |
your game’s event for getting an item |
Events every game has
These come from Chatterbox, so they work without any game code:
| Event | What it does | In the file |
|---|---|---|
| Jump to | Goes to another node. | <<jump Harbour>> |
| Hop to | Visits a node, then comes back. | <<hop Shop>> |
| Hop back | Goes back to where the last hop came from. | <<hopback>> |
| Stop | Ends the conversation. | <<stop>> |
| Wait | Waits for the player before the next line. | <<wait>> |
| Set / Add | Changes a variable. | <<set $courage to $courage + 1>> |
| Pick one at random | The game picks one of the options below. | <<random option>> |
See Options, jumps and hops and Variables and unlocks.
Your game’s events
Every other event is a function in your game’s code. Your game registers it with Chatterbox, and Tsumugi reads it from there. Items, areas, portraits, sounds, the map and unlocks all work this way.
Events that give or take items, change areas, or show portraits are matched to your game’s art. When a picture is missing, the event shows needs art (amber). See Missing art and code.
Make a new event
Need an event your game doesn’t have yet? Type it after >. When nothing fits, the menu offers Create a new event “…”. Pick it, and the New event box opens.
- Write the event the way you would type it after
>, likeplays the {name:text} sound. - Add what it needs with the buttons: an item, a node, a portrait, a number, some text.
- Pick an icon, then click Create event.
Tsumugi adds an empty function for it to your game’s story actions script. The event shows needs code (purple) until a programmer writes what it does.
For programmers
Tsumugi reads each ChatterboxAddFunction line in your game’s code. A comment directly above it gives the event its words and icon:
// @tsumugi gets {item} #backpack
ChatterboxAddFunction("addItem", inventory_add);
- The words after
@tsumugiare what the writer types after>.{item}marks a value. #backpackis the tag’s icon.- A function Tsumugi made has a
@tsumugi-stubline. Write the code, then delete that line. The event stops showing needs code.
An event that is more than one function can be described in tsumugi.json, under actions. See tsumugi.json.