Development (dev) - Script
Quest Index - Language: english - french - polish - italian
init
//--------------------------------------------
// DEV QUEST SCRIPT
//--------------------------------------------
// Country: Italy - Firenze
// Content: Living document for testing Yarn features
// and documenting available commands
//--------------------------------------------
//--------------------------------------------
// INIT
// every quest starts with an INIT node
// to inizialize existing variables and declare new ones
//--------------------------------------------
// title of a node must be unique to this quest
// create a new node for anything that must be referenced multi times
// that makes understanding of the flow easier
// position is used to place the node in the Graph view in the Editor
// group is used to organize the nodes in the Graph view in the Editor
group: docs
// tags are used to add metadata to the node
// - actor is the speacking character, used mostly for voice overs
// - type is used to identify special nodes like Start, End, Quiz
tags: actor=Guide, type=Quiz
// color us used like this:
// - red for important nodes like init and quest end
// - blue for NPCs
// - yellow for items
// - green for tasks
// - purple for activities
color: red
---
// these are the common variables
<<set $EASY_MODE = false>>
<<set $IS_DESKTOP = false>>
<<set $TOTAL_COINS = 0>>
<<set $COLLECTED_ITEMS = 0>>
<<set $MAX_PROGRESS = 0>>
<<set $CURRENT_PROGRESS = 0>>
<<set $CURRENT_ITEM = "">>
// here we declare new variables for this quest
<<declare $met_teacher = false>>
<<declare $got_hint = false>>
<<declare $doorUnlocked = false>>
docs_commands
//--------------------------------------------
// COMMANDS
// these are the commands available in the game
//--------------------------------------------
group: docs
color: red
---
// execute the configured action in the actionManager
<<action action_id>>
// camera commands
<<camera_focus palace>>
<<camera_reset>>
<<card fr_baguette show>>
<<card_hide>>
// shows the image
<<asset id_asset>>
// hides the current image
<<asset_hide>>
// adds the item = card to the inventory (needs to be collectable!)
<<inventory id_card add>>
<<inventory id_card>> // same as add
<<inventory id_card remove>>
// starts a task
<<task_start id_task_configuration>>
// end a task... if you say nothing, its a success
<<task_end id_task_configuration>>
<<task_end id_task_configuration fail>>
<<task_end>> // or even without the id to end current task
// launches an activity
<<activity id_activity_configuration>>
// end current quest and calculate stars based on progress
<<quest_end>>
// end the current quest with n (0, 1,2,3) stars
<<quest_end 3>>
// --- Yarn built-in commands ---
<<wait 3>> // waits for 3 seconds
<<stop>> // stops the current dialogue>>
docs_functions
//--------------------------------------------
// FUNCTIONS
// these are the functions available in the game
//--------------------------------------------
color: red
group: docs
---
// these are the functions available in the game
<<if item_count("flag_france") >= 2>>
You have more than 2 Flags of France
another line
<<endif>>
<<if has_item("flag_france")>>
You have a Flag of France
<<endif>>
<<if has_item_at_least("flag_france", 3)>>
You have at least 3 Flags of France
<<endif>>
<<if can_collect("flag_france")>>
You can collect a Flag of France
<<endif>>
test_inventory
group: inventory
---
I am hungry. how about some food?
<<if has_item_at_least("fr_baguette", 3)>>
I need 3 baguettes!
<<inventory fr_baguette remove>>
<<inventory fr_baguette remove>>
<<inventory fr_baguette remove>>
<<else>>
You don't have enough baguettes!
<<if has_item("fr_fish")>>
But you have some fish!
<<endif>>
Thank you.
<<endif>>
got_baguette
group: inventory
---
You found a baguette!
<<inventory fr_baguette add>>
got_fish
group: inventory
---
An healthy fish!
<<inventory fr_fish add>>
test_cards
group: cards
---
Now i show you some cards
<<card fr_fish>>
Please look at its details
<<card fr_fish zoom>>
go back to the menu and browse the cards
and now...
<<card fr_baguette>>
Good, isnt' it?
<<card_hide>>
GO back to work now.
test_camera
group: camera
---
Now i show you the map of the playgroud
<<camera_focus map_tutorial>>
Do you see that point?
<<camera_focus map_tutorial_detail>>
Now Look at that palace!
<<camera_focus palace>>
Nice isnt' it?
<<camera_reset>>
test_actions
tags: actor=KID_FEMALE
group: actions
---
<<action activate_elevator>>
Action Pre "pre_actions" and action_post "post_actions"
Do you want to open the Chest?
-> Yes
<<action open_chest>>
-> No
<<action stop_elevator>>
task_collect_apples
tags:
group: tasks
color: green
---
<<if HasCompletedTask("collect_apples")>>
Thank you! you finished this task
<<elseif GetCollectedItem("collect_apples") > 0 >>
I need more apples!
<<else>>
Collect 4 apples!
<<task_start collect_apples task_collect_apples_done>>
<<endif>>
task_collect_apples_done
tags:
group: tasks
color: green
---
Well done! Go back to the robot
task_open_chest
tags:
group: tasks
color: green
---
<<if HasCompletedTask("open_chest")>>
Thanks you... I needed that
<<else>>
Reach and open that chest!
<<task_start open_chest task_open_chest_done>>
<<endif>>
task_open_chest_done
tags:
group: tasks
color: green
---
Well done! You opened the chest.
item_chest
tags: actor=TUTOR
group: actions
color: yellow
---
A good chest!
<<action open_chest>>
test_quiz
group: quiz
tags: type=quiz
---
Calculate 3*2
-> 4
<<jump test_quiz_wrong>>
-> 6
<<jump test_quiz_correct>>
-> 8
<<jump test_quiz_wrong>>
test_quiz_correct
group: quiz
---
YES! Correct.
test_quiz_wrong
group: quiz
---
GUIDE: No. Do you want to try again?
-> Yes
<<jump test_quiz>>
-> No
endgame
group: endgame
color: red
---
You can end this quest with...
-> Zero stars (fail)
<<quest_end 0>>
-> 1 star
<<quest_end 1>>
-> 2 stars
<<quest_end 2>>
-> 3 stars
<<quest_end 3>>
NPCGIoconda
assetimage: antura_hero
---
<<asset food_tomato>>
ciao, stefano
ti piacciono le foto?
<<asset food_fish>>
-> vuoi arancia?
<<asset food_orange>>
<<action play_sfx>>
-> vuoi olio?
<<asset food_oil>>
<<action play_sfx>>
ora chiudo
<<asset_hide>>
-> Activity Order
<<activity activity_test>>
<<jump activity_done>>
-> Suona sfx
<<action play_sfx>>
-> Apri Baule
<<action open_chest>>
activity_done
---
Activity finished.
NPCGreeting2
assetimage: pirates
---
// <<activity activity_memory>>
Narrator: Hallo
Narrator: How are you?
-> Good
Narrator: Good to hear that
-> Bad
Narrator: Oh, I am sorry to hear that
-> Neutral
Narrator: I see, I hope it gets better soon
Narrator: What do you want to do with coins?
NPCGreeting3
tags: #camera2 background:conductor_cabin
---
<<declare $coins = 0>>
Narrator: What do you want to do with {$coins} coins?
-> Open the door
<<set $doorUnlocked = true>>
Narrator: The door is open
-> Stay at home
Narrator: You stay at home
<<set $coins = $coins + 10>>
Chest_01
---
<<if $doorUnlocked>>
Narrator: la porta è aperta
<<jump EntroInCasa>>
<<else>>
Narrator: la porta è chiusa
<<endif>>
note_for_the_editors
style: note
---
Custom note
this is useful to leave notes for the editors
like reminders of things to do
or things to check
or things to fix
EntroInCasa
---
entro in casa
coin_machine
tags:
group: variables
---
I'll give you 100 coins.
<<set $TOTAL_COINS = $TOTAL_COINS + 100>>
test_mood
tags: actor=GUIDE, mood=HAPPY
---
Happy Mood
random_lines
tags: actor=OLD_WOMAN
group: random
---
Smart random Line 1
Smart random Line 2
Smart random Line 3
multiple_lines
tags: actor=KID_FEMALE
group: random
---
=> This is Hint 1
=> This is Hint 2
=> Hint 3
activity_canvas
group: activities
color: purple
---
Activity CANVAS!
<<activity activity_canvas activity_canvas_result>>
activity_canvas_result
group: activities
color: purple
---
<<if GetActivityResult("activity_canvas") > 0>>
You played CANVAS activity well!
<<else>>
Try again.
<<endif>>
activity_jigsaw
group: activities
color: purple
---
Activity JIGSAW PUZZLE!
<<activity activity_jigsaw activity_jigsaw_result>>
activity_jigsaw_result
group: activities
color: purple
---
<<if GetActivityResult("activity_jigsaw") > 0>>
You played JIGSAW PUZZLE activity well!
<<else>>
Try again.
<<endif>>
activity_memory
group: activities
color: purple
---
Activity MEMORY!
<<activity activity_memory activity_memory_result>>
activity_memory_result
group: activities
color: purple
---
<<if GetActivityResult("activity_memory") > 0>>
You played MEMORY activity well!
<<else>>
Try again.
<<endif>>
activity_match
group: activities
color: purple
---
Activity MATCH!
<<activity activity_match activity_match_result>>
activity_match_result
group: activities
color: purple
---
<<if GetActivityResult("activity_match") > 0>>
You played MATCH activity well!
<<else>>
Try again.
<<endif>>
activity_money
group: activities
color: purple
---
Activity MONEY!
<<activity activity_money activity_money_result>>
activity_money_result
group: activities
color: purple
---
<<if GetActivityResult("activity_money") > 0>>
You played MONEY activity well!
<<else>>
Try again.
<<endif>>
activity_order
group: activities
color: purple
---
Activity ORDER!
<<activity activity_order activity_order_result>>
activity_order_result
group: activities
color: purple
---
<<if GetActivityResult("activity_order") > 0>>
You played ORDER activity well!
<<else>>
Try again.
<<endif>>
activity_piano
tags: actor=KID_FEMALE
group: activities
color: purple
---
Play this PIANO Melody!
<<activity activity_piano activity_piano_result>>
activity_piano_result
tags: actor=KID_FEMALE
group: activities
color: purple
---
<<if GetActivityResult("activity_piano") > 0>>
You played the PIANO activity well!
<<else>>
Try again.
<<endif>>