跳到主要内容

NPC 与生物目标

找 NPC、摸摸动物、喂羊剪毛,这一页的 6 种类型在编辑器的「NPC 与对话」分类里。

例子​

先去找铁匠说一声,再驯服一只狼:

plugins/StarQuest/quests/示例/铁匠的狼.yml
format: 1
id: 铁匠的狼
name: '&f铁匠的狼'
category: 示例
icon: BONE
settings:
start: {command: true}
repeat: {mode: once}
rewards:
- {type: give, item: BONE, amount: 16}
nodes:
开始:
type: start
x: 0
y: 100
next: [找铁匠]
找铁匠:
type: objective
x: 260
y: 100
track-text: 铁匠好像有话要说
goals:
- {type: npc, npc: 铁匠, display: '去找铁匠'}
next: [驯狼]
驯狼:
type: objective
x: 520
y: 100
track-text: 帮铁匠驯一只狼
goals:
- {type: tame, entity: [WOLF], amount: 1, display: '驯服一只狼'}
next: [完成]
完成:
type: end
x: 780
y: 100
result: complete

铁匠 要先在 npcs.yml 登记。追踪栏先显示「去找铁匠」,右键铁匠后换成「驯服一只狼」。

跟 NPC 说话 npc​

右键某个 NPC。当开始触发用就是「点 NPC 接任务」,NPC 头上会出现任务标记,见 NPC 头上的标记。

  • npc(NPC):必填,npcs.yml 里的别名
  • amount(数量):要点几次,平常不用写
triggers:
- {type: npc, npc: 村长}

要真的对话(台词、选项),用 对话节点,不用这个目标。

点击生物 interact-entity​

右键任何生物,只算主手。

  • entity(生物):可写多个,不写 = 任意
  • name(名称包含):生物的自订名称要包含这段文字
  • amount(数量)
goals:
- {type: interact-entity, entity: [CAT], amount: 3, display: '摸摸村里的猫 {progress}/{amount}'}

繁殖动物 breed​

  • entity(动物):可写多个,不写 = 任意
  • amount(数量)
goals:
- {type: breed, entity: [COW, SHEEP], amount: 4}

驯服动物 tame​

  • entity(动物):可写多个,不写 = 任意
  • amount(数量)
goals:
- {type: tame, entity: [HORSE], amount: 1}

剪羊毛 shear​

  • amount(数量)
  • color(羊的颜色):原版颜色名,例如 WHITE、BLACK、PINK。不写 = 任意
goals:
- {type: shear, color: PINK, amount: 2}

骑乘 ride​

骑上马、猪、船、矿车这类坐骑时算。

  • entity(坐骑):可写多个,不写 = 任意
goals:
- {type: ride, entity: [HORSE], display: '骑上一匹马'}

会踩的坑​

npc 写的是 npcs.yml 里的别名,不是 NPC 头上显示的名字。没登记的别名点了不会有反应。

玩家同时有好几个进行中的任务都在等同一个 NPC 时,点一下只算给其中一个任务,再点一下才轮到下一个。

点击生物、骑乘都只看生物种类,不分是不是自己的。要限定某只特定的生物,用 name 比对它的名字。

0:000:00