First Script
Writing Your First Messageβ
In the Web Editorβ
-
Open the Developers Portal and create a new project
-
The editor opens with a starting chapter already created β this
Startnode is the entry point of your story -
The starting node is a good place to declare variables. Create a new chapter by clicking the + button in the sidebar, and add your first story node:
title: my_first_node
checkpoint_name: "Beginning"
---
Hello, I'm your first message
-> And I'm your first button
I can help you write stories!
=== -
Go back to the
Startchapter and link to your new node:title: Start
is_entry_point: true
---
// Declare your variables here
<<declare $player_name = "Agent">>
<<jump my_first_node>>
=== -
Press the Play button (βΆ) to test your story in the built-in debugger
- Type
\\to quickly insert commands (e.g.,\\wait,\\jump,\\declare) - Press
-at the start of a line to auto-insert->for options - Use
Ctrl+B,Ctrl+I,Ctrl+Uto format selected text - Press
Ctrl+Sto save your script - See the Web Editor section for all features
Using Local .yarn Files (Legacy)β
-
Create a new script file: Create a new file named
my_first_chapter.yarn. -
Create your first node:
title: my_first_node
---
Hello, I'm your first message
-> And I'm your first button
I can help you write stories!
=== -
Save the file and open the
start.yarnfile. -
Link your new node by adding
<<jump my_first_node>>:// Jump to your start node
<<jump my_first_node>>
===
Uploading Your Story (Legacy)β
This section applies only if you are using the legacy method with local .yarn files. If you are using the web editor, your story is saved automatically β just click Save in the editor toolbar.
- Go to Developers Portal and create a new project.
- After creation, the web editor will open automatically β close the editor and return to the project page.
- Use the Update by .yarn option to upload your
.yarnfiles.