Skip to content

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 #line:08a1058 #native
    another line #line:0563122 
<<endif>>

<<if has_item("flag_france")>>
    You have a Flag of France #line:kidm_0b932d0 
<<endif>>

<<if has_item_at_least("flag_france", 3)>>
    You have at least 3 Flags of France #line:0d694f1 
<<endif>>

<<if can_collect("flag_france")>>
    You can collect a Flag of France #line:03da430 
<<endif>>


test_inventory

group: inventory
---
I am hungry. how about some food? #line:0bdf566 
<<if has_item_at_least("fr_baguette", 3)>>
    I need 3 baguettes! #line:00c341e 
    <<inventory fr_baguette remove>>
    <<inventory fr_baguette remove>>
    <<inventory fr_baguette remove>>
<<else>>
    You don't have enough baguettes! #line:0c0d786 
    <<if has_item("fr_fish")>>
        But you have some fish! #line:06c9370 
    <<endif>>
    Thank you. #line:0a7921b 
<<endif>>


got_baguette

group: inventory
---
You found a baguette! #line:dev_got_baguette 
<<inventory fr_baguette add>>


got_fish

group: inventory
---
An healthy fish! #line:dev_got_fish 
<<inventory fr_fish add>>


test_cards

group: cards 
---
Now i show you some cards #line:05edfca 
<<card fr_fish>>
Please look at its details #line:0adbe4f 
<<card fr_fish zoom>>
go back to the menu and browse the cards #line:017a620 
and now... #line:04ade19 
<<card fr_baguette>>
Good, isnt' it? #line:04b02ce 
<<card_hide>>
GO back to work now. #line:0970ed1 


test_camera

group: camera 
---
Now i show you the map of the playgroud #line:0c58bd8 
<<camera_focus map_tutorial>>
Do you see that point? #line:03e0224 
<<camera_focus map_tutorial_detail>>
Now Look at that palace! #line:0c1b2e4 
<<camera_focus palace>>
Nice isnt' it? #line:04daace 
<<camera_reset>>


test_actions

tags: actor=KID_FEMALE
group: actions
---
<<action activate_elevator>>
Action Pre "pre_actions" and action_post "post_actions" #line:0a67b25 
Do you want to open the Chest? #line:03cae39 
-> Yes #line:067231b 
    <<action open_chest>>
-> No #line:05d9657 
<<action stop_elevator>>

task_collect_apples

tags:
group: tasks
color: green
---
<<if HasCompletedTask("collect_apples")>>
    Thank you! you finished this task #line:dev_task_collect_apples_2
<<elseif GetCollectedItem("collect_apples") > 0 >>
    I need more apples! #line:dev_task_collect_apples_3
<<else>>
    Collect 4 apples! #line:dev_task_collect_apples_1 
    <<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 #line:dev_test_task_done_1 

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! #line:dev_item_chest_1 
<<action open_chest>>

test_quiz

group: quiz
tags: type=quiz
---
Calculate 3*2 #line:dev_test_quiz_1 
-> 4 #line:dev_test_quiz_2 
    <<jump test_quiz_wrong>>
-> 6 #line:dev_test_quiz_3 
    <<jump test_quiz_correct>>
-> 8 #line:dev_test_quiz_4 
    <<jump test_quiz_wrong>>

test_quiz_correct

group: quiz

---
YES! Correct. #line:0eb010e 

test_quiz_wrong

group: quiz

---
GUIDE: No. Do you want to try again? #line:0e2b8d7 
-> Yes #line:08ff2b9 
    <<jump test_quiz>>
-> No #line:042881c 

endgame

group: endgame
color: red
---

You can end this quest with... #line:027bdca 
-> Zero stars (fail) #line:0130629 
    <<quest_end 0>>
-> 1 star #line:05caf8d 
    <<quest_end 1>>
-> 2 stars #line:02466da 
    <<quest_end 2>>
-> 3 stars #line:0f65a6b 
    <<quest_end 3>>


NPCGIoconda

assetimage: antura_hero
---
<<asset food_tomato>>
ciao, stefano #line:0c0329c 
ti piacciono le foto? #line:0b9b60d 
<<asset food_fish>>
-> vuoi arancia? #line:0c2bd41 
    <<asset food_orange>>
    <<action play_sfx>>
-> vuoi olio? #line:034ed48 
    <<asset food_oil>>
    <<action play_sfx>>
ora chiudo #line:0baeb5f 
<<asset_hide>>
-> Activity Order #line:0087ab1 
    <<activity activity_test>>
    <<jump activity_done>>
-> Suona sfx #line:0f02889 
    <<action play_sfx>>
-> Apri Baule #line:053f800 
    <<action open_chest>>


activity_done

---
Activity finished. #line:0ce187d 

NPCGreeting2

assetimage: pirates
---
// <<activity activity_memory>>
Narrator: Hallo #line:08ecb6c 
Narrator: How are you? #line:00b7839 
-> Good #line:0991140 
    Narrator: Good to hear that #line:0b3477e 
-> Bad #line:08607a4 
    Narrator: Oh, I am sorry to hear that #line:0e6ecb2 
-> Neutral #line:05f3ea5 
    Narrator: I see, I hope it gets better soon #line:0802baf 
Narrator: What do you want to do with  coins? #line:0bcd506 

NPCGreeting3

tags: #camera2 background:conductor_cabin
---

<<declare $coins = 0>>
Narrator: What do you want to do with {$coins} coins?  #line:0a1994c 
-> Open the door #line:0e11bee 
 <<set $doorUnlocked = true>>
 Narrator: The door is open #line:0cac01d 
-> Stay at home #line:07f4239 
 Narrator: You stay at home #line:079b16e 
 <<set $coins = $coins + 10>>

Chest_01

---
<<if $doorUnlocked>>
Narrator: la porta è aperta #line:0e22a89 
<<jump EntroInCasa>>
<<else>>
Narrator: la porta è chiusa #line:05086bc 
<<endif>>

note_for_the_editors

style: note
---
Custom note #line:04d621e 
this is useful to leave notes for the editors #line:0520fb4 
like reminders of things to do #line:078fe99 
or things to check #line:0982259 
or things to fix #line:096379b 

EntroInCasa

---
entro in casa #line:0f92df5 


coin_machine

tags:
group: variables
---
I'll give you 100 coins. #line:06427f9 
<<set $TOTAL_COINS = $TOTAL_COINS + 100>>


test_mood

tags: actor=GUIDE, mood=HAPPY
---
Happy Mood #line:0a6e648 


random_lines

tags: actor=OLD_WOMAN
group: random
---
Smart random Line 1 #line:07193d8 
Smart random Line 2 #line:06fe9a7 
Smart random Line 3 #line:032e777 

multiple_lines

tags: actor=KID_FEMALE
group: random
---
=> This is Hint 1 #line:0423295 
=> This is Hint 2 #line:00d69e5 
=> Hint 3 #line:08966ba 


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! #line:0e11b77 
<<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>>