线路组

为了让您的对话更加生动和多样化,您还可以在台词组中提供台词。当线位于线组中时,纺纱机将为您选择其中之一。

线组是以 a 开头的线的集合 => 象征:

title: Start
---
Captain: Navigator, fire the glitter torpedoes! That'll confuse the enemy ships!
=> Navigator: *sighs deeply* Sir, we don't have 'glitter torpedoes.' Those were in your dream last night.
=> Navigator: *eyes roll skyward* Captain, weaponizing craft supplies is not part of standard space combat protocol.
=> Navigator: *Slumps shoulders in defeat* I'll... make a note in the log that you suggested tactical glitter, sir.
===

在这个例子中,船长会说“Navigator, fire the glitter torpedoes! That'll confuse the enemy ships!”,然后纺纱机将选择后续线路之一进行响应。

[!信息] 线路组非常适合运行“吠叫”——需要运行以响应游戏内事件的短线路集合。将它们视为 Yarn Spinner 的现有选项可能会很有用 -> 语法,但不是玩家选择要运行的内容,而是计算机为您选择它:

=> Guard: Halt!
=> Guard: No entry!
=> Guard: Stop!

您可以将条件附加到线路组中的线路,以确保它们仅在适当的时候运行。条件可以是任何 true 或 false 表达式,也可以与 once 关键字确保一行只能运行一次:

=> 守卫:您好,公民。
=> 守卫:你好,旅行者。
 守卫:保持警惕。 // 在“你好,旅行者”之后运行。
=> 守卫:万岁,冒险家! <<如果$player_is_adventurer>>
=> 守卫:我曾经和你一样是个冒险家,但后来我的膝盖中了一箭。 <<如果$player_is_adventurer则一次>>

在 Try Yarn Spinner 中运行此示例

线路组中的线路还可以有属于它的其他线路,如果选择该项目,这些线路将运行。