Add #line:identifier to tag lines for localization:
Lilith: Welcome to my shop! #line:shop_greetingMorpheus: I'm just browsing. #line:shop_browse
Write dialogue in English directly in your .yarn files. Line IDs connect to translation entries in CSV localization files (e.g., zh-cn.csv). See Project Development for the localization workflow.
Lilith: What would you like?-> Buy potions Lilith: Excellent choice!-> Ask about rumors Lilith: I've heard some interesting things...-> Leave Lilith: Come back anytime!
Indented content under an option runs when that option is selected.
-> Ask about rumors Lilith: What kind of rumors? -> About the forest Lilith: Strange lights have been seen... -> About the castle Lilith: They say it's haunted.
Use <<if>>, <<elseif>>, and <<else>> for branching:
<<if $gold >= 50>> Lilith: You can afford that potion.<<elseif $gold >= 25>> Lilith: You're a bit short on gold.<<else>> Lilith: Come back when you have more coin.<<endif>>
title: ShopEntrance---Lilith: Welcome! What brings you here?-> I want to buy something <<jump ShopBuy>>-> Just looking <<jump ShopBrowse>>===title: ShopBuy---Lilith: Let me show you my wares.===
<<if get_gold() >= 100>> Lilith: You look wealthy!<<endif>><<if is_own_character(1003)>> Lilith: Sartre is with you? How wonderful!<<endif>>
Many functions take integer IDs rather than string names. Character IDs, item IDs, and value IDs are defined in the game’s internal data tables. See the Functions Reference for parameter types.
Use functions in expressions:
Lilith: You have {get_gold()} gold.Lilith: Your strength is {get_player_attribute("STR")}.