• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

“QuestCreator/教程”的版本间的差异

来自Minecraft插件百科
跳转至: 导航搜索
你成功地创建了正确的任务目标
第298行: 第298行:
 
任务目标有强制和可选参数.
 
任务目标有强制和可选参数.
  
强制参数The mandatory parameters are usually always specified when you copy paste an object on : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>
+
强制参数经常指定你复制粘帖的任务目标,详情查看 : [[QuestCreator/任务目标]]
  
But the optional ones aren't directly in the object type. They are on the top of the page.
+
但可选参数不在任务目标类型内. 他们在此页上方.
  
Let's give them to you here :
+
以如下方式获取 :
  
<code>name</code> (optional) is the object name. For instance : "Break 10 cobblestone on the ground"<code>progress_name</code> (optional) is the short object name. It'll be used in the GUI or in the /quest progress command for example. For instance : "Break cobblestone" <code>message</code> (optional) is a text that'll be send when the object starts. <code>sound</code> (optional) is a sound that'll be played when the object starts.<code>post_message</code> (optional) is a text that'll be send when the object ends. <code>post_sound</code> (optional) is a sound that'll be played when the object ends. <code>location</code> is the location settings for the object (detailed below).
+
<code>name</code> (可选) 为任务目标名. 举个例子 : "Break 10 cobblestone on the ground"<br>
 +
<code>progress_name</code> (可选)为任务目标名缩写. 这会被用于菜单或 /quest progress 指令内. : "Break cobblestone"<br>
 +
<code>message</code> ((可选) 为在任务目标开始时发送的文本.<br>
 +
<code>sound</code> (可选) 为玩家接受任务发出的音效.<br>
 +
<code>post_message</code> (可选) 为任务目标结束后发送的文本. <br>
 +
<code>post_sound</code> (可选) 为任务目标结束后发出的音效.  
 +
<code>location</code> 为任务目标的地点设置 (详情请看下面).
  
The location setting can be either very useful or completely mandatory for some objects.
+
地点设置对一些任务目标很有用.
  
Let's explain how to use them !
+
让我来解释怎么使用地点设置吧 !
  
Here's an example of object with a lot of settings in here.
+
以下为示例设置.
 
       CRAFT_A_PICKAXE:
 
       CRAFT_A_PICKAXE:
 
  <nowiki> </nowiki>      type: PLAYER_ITEM_CRAFT
 
  <nowiki> </nowiki>      type: PLAYER_ITEM_CRAFT
第316行: 第322行:
 
  <nowiki> </nowiki>        type: DIAMOND_PICKAXE
 
  <nowiki> </nowiki>        type: DIAMOND_PICKAXE
 
  <nowiki> </nowiki>        amount: 1
 
  <nowiki> </nowiki>        amount: 1
  <nowiki> </nowiki>      name: 'Craft a diamond pickaxe for your friend'
+
  <nowiki> </nowiki>      name: '制作一把钻石镐'
 
  <nowiki> </nowiki>      progress_name: 'Craft diamond pickaxe'
 
  <nowiki> </nowiki>      progress_name: 'Craft diamond pickaxe'
  <nowiki> </nowiki>      message: '&aI<nowiki>''</nowiki>m showing at the very start of the object, when the player didn<nowiki>''</nowiki>t complete it yet ! So now, you need to craft a diamond pickaxe.'
+
  <nowiki> </nowiki>      message: '&a这是任务最开始的时候发送的消息! 请制作一把钻石镐.'
 
  <nowiki> </nowiki>      sound:
 
  <nowiki> </nowiki>      sound:
 
  <nowiki> </nowiki>        type: VILLAGER_IDLE
 
  <nowiki> </nowiki>        type: VILLAGER_IDLE
 
  <nowiki> </nowiki>        volume: 1.0
 
  <nowiki> </nowiki>        volume: 1.0
 
  <nowiki> </nowiki>        pitch: 1.0
 
  <nowiki> </nowiki>        pitch: 1.0
  <nowiki> </nowiki>      post_message: '&aI<nowiki>''</nowiki>m showing only when the object is totally finished ! Good job crafting this pickaxe man.'
+
  <nowiki> </nowiki>      post_message: '&a你成功地制作了一把钻石镐 !'
 
  <nowiki> </nowiki>      post_sound:
 
  <nowiki> </nowiki>      post_sound:
 
  <nowiki> </nowiki>        type: LEVEL_UP
 
  <nowiki> </nowiki>        type: LEVEL_UP
第332行: 第338行:
 
  <nowiki> </nowiki>        near: 10
 
  <nowiki> </nowiki>        near: 10
 
  <nowiki> </nowiki>      goto: QUEST_SUCCESS
 
  <nowiki> </nowiki>      goto: QUEST_SUCCESS
Let's explain this so you understand everything,
+
让我来解释以下这些东西,
  
I have added name, progress_name, message, sound, post_message, post_sound and location. Those are optional settings (except for objects with location, mostly SERVER objects that need to know where to do their action).
+
我添加了任务名、进度名、消息、音效、结束消息、结束音效和地点. 这些是可选选项 (除了需要用到地点的任务目标).
  
What does it mean ? It means that you can put them in every object and they will work. They are called "generic settings".
+
这意味着什么 ? 这意味着你可以把这些东西放入每一个任务目标内使用. 这些选项称为 "常规设置".
  
<code>name</code> will be used in things such as <code>/quest progress</code> and other features of the plugin.<code>progress_name</code> will be used in <code>/quest progress</code> and the GUI items. <code>message</code> is a graphical settings, shown at the beginning, very useful if you want to tell to a player the actual objective he has to do now. It can has multiple lines with colors. <code>sound</code> is an audio setting works the same way as message<code>post_message</code> is also a graphical settings, shown at the end of the object <code>post_sound</code> is also an audio setting, and works the same way as post_message
+
<code>name</code> 用于如 <code>/任务进度</code>和其他插件的功能.<br>
 +
<code>progress_name</code> 会用于 <code>/quest progress</code> 和任务菜单物品. <code>message</code> 为图形化设置, 在任务开始时显示. 可添加多行带有颜色的消息. <br>
 +
<code>sound</code> 和消息一样设置<br>
 +
<code>post_message</code>也是一项常规设置,在任务目标结束后显示消息<br>
 +
<code>post_sound</code> 同上,在任务目标结束后发出音效
  
And location can be used almost everywhere. In fact in some case it will be mandatory (again, for some SERVER objects, for example SERVER_BLOCK_PLACE : the server needs to know where to change the block).
+
地点设置可用于大多数地方.<br>
  
 
以下是一些示例.
 
以下是一些示例.
  
Initial object, it works :
+
最初的任务目标 :
 
       object:
 
       object:
 
         type: PLAYER_ITEM_DROP
 
         type: PLAYER_ITEM_DROP
第350行: 第360行:
 
           type: DIAMOND_PICKAXE
 
           type: DIAMOND_PICKAXE
 
         amount: 1
 
         amount: 1
With location, it also works :
+
带有地点设置的任务目标 :
 
       object:
 
       object:
 
         type: PLAYER_ITEM_DROP
 
         type: PLAYER_ITEM_DROP
第359行: 第369行:
 
           base: world,100,70,100
 
           base: world,100,70,100
 
           near: 10
 
           near: 10
... but here I say to the plugin that I want the player to drop 1 DIAMOND_PICKAXE but in a zone with a spheric radius with a center in x 100, y 70 and z 100. If he drops it elsewhere, the object won't complete.
+
... 如果我想要玩家在指定范围的区域内丢弃一个钻石镐. 如果玩家在此范围外丢弃则无效.
  
So it can be very useful to do some accurate actions.
+
所以地点设置可用于精确的任务行为.
  
But in this object :
+
可用于这个目标 :
 
       object:
 
       object:
 
         type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
 
         type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
 
         schematic_file: 'schematic_file.schematic'
 
         schematic_file: 'schematic_file.schematic'
In this case you tell the plugin to paste a schematic file, but as you may know WorldEdit is a coordinate-relative plugin. In such a case, you have to put the location of the paste origin or it won't work.
+
在这个示例中插件会粘帖一个schematic文件, 但你知道 WorldEdit 和地点设置有关. 所以你需要设置粘帖的地点.
 
       object:
 
       object:
 
         type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
 
         type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
第464行: 第474行:
 
第一个 <code>amount:</code> in the item is the number of items that will be given to the player. The second <code>amount:</code> in the object, ''written under the type and the item parameters'', is the amount of time this action will be repeated. Can be useful if you want the player to do one object multiple times. I let you imagine what you can do with this feature.
 
第一个 <code>amount:</code> in the item is the number of items that will be given to the player. The second <code>amount:</code> in the object, ''written under the type and the item parameters'', is the amount of time this action will be repeated. Can be useful if you want the player to do one object multiple times. I let you imagine what you can do with this feature.
  
If you find yourself stuck in front of an issue in your quest, it might be a simple syntax error messing everything up. So don't hesitate to first check what you've written on a YAML validator, such as : <nowiki>https://codebeautify.org/yaml-validator</nowiki>
+
如果你在编辑任务时遇到问题并且卡住, 那么你就有可能犯了语法错误,首先确保你使用支持YAML的编辑器,比如notepad++
  
Second check if you have any tabulation, YAML absolutely needs only spaces, not tabulations.
+
检测你的YAML格式是否规范.
  
 
= 总结 =
 
= 总结 =
第560行: 第570行:
 
  <nowiki> </nowiki>        - '&cLove red color m8'
 
  <nowiki> </nowiki>        - '&cLove red color m8'
 
  <nowiki> </nowiki>        goto: QUEST_SUCCESS
 
  <nowiki> </nowiki>        goto: QUEST_SUCCESS
干得漂亮,你成功地完成了第一个任务的编辑! ''As you can see, it can already seem a little complicated just to interact with a NPC, so, again, organisation is very important in your files.''
+
干得漂亮,你成功地完成了第一个任务的编辑! ''你可以看到,与NPC交互等功能使得这个任务已经有点复杂了.
  
You now know the bases to create any quest you want. Yes, really. You will just need some testing, experimentations and patience and everything that comes out of your imagination should be playable one day. Just think outside the box : a LOT is possible.
+
现在你获得了创建任务的基础知识. 你还需要进行测试、联系才能使你对任务的编辑运筹帷幄. 突破思维的束缚 : 一切皆有可能.
  
If you are having any issue after having checked everything on your side, don't hesitate to go on the support discord, we will be happy to help you !
+
如果你遇到了问题且经过检查后找不到问题所在,你可以加入discord寻求帮助 !
  
You can also come and share your creations and your use of quest mechanics, on the same discord ! ^_^
+
你也可以在discord里分享你的任务和任务机制 ! ^_^
  
Thanks for reading this tutorial ! (NB : and thumbs up again to Lordinouille who wrote it, that's a pretty good job !)
+
感谢阅读这篇教程 ! (提醒 : 为编写了这篇教程的 Lordinouille 点赞 !)
  
Now, that's your turn. The plugin is just awaiting : it's up to you to create quests !
+
现在是你的回合了. 插件等待你探索 : 任务的创建取决于你 !

2019年6月9日 (日) 14:27的版本

全面教程

这个教程主要由 Lordinouille 编写(十分感谢 :D), 并由 PYRRH4 审核. 如果你想要购买这款插件或是想要了解如何使用这款插件的话这个教程就很有用.

这个教程写于 QuestCreator v4.0.0 版本之前所有没有 'pseudo-scripting' 特点的解释.

教程的第一个目的是学习如何使用文件创建一个任务. YAML 文件更加准确且你可以掌控更多东西. 但是如果你觉得配置文件很麻烦, 你完全可以使用游戏内的编辑器但还是建议你阅读这部分教程.

请毫不犹豫地先看一下这一页面,这个页面包括了默认的示例任务文件, 你可以在这里看到"行为"的解释 : https://github.com/PYRRH4/QuestCreator/wiki/Create-a-quest

如果你对这部分内容不理解,你可以来discord服务器提问. 链接在插件页面 :)

任务之始

任务配置主要分成两部分, 设置和目标 :

  • 设置为任务的常用参数, 你可以设置任务如何开始、完成任务所需时间、开始任务缩写权限、GUI菜单物品等.
  • 目标按任务分支分组并被视为任务的不同路径目标(同一个意思).目标分为两种, 玩家 服务器.

这两部分的详解请看下面.


设置

设置的wiki页面 (建议阅读) : https://github.com/PYRRH4/QuestCreator/wiki/Create-a-quest

常用设置

位于文件开头 :

setting1: ...
setting2: ...
setting3: ...

实际设置:

saving: ENABLED
name: 'Example Quest'
description:
  - '&7Just a sample quest'
max_concurrent_instances: -1
max_concurrent_instances_queue: true
min_players: 1
max_players: 1
max_completions: 1
time_limit: 0
cooldown: DISABLED
actionbar: ''
send_status_message: true
send_objective_update_message: true
restricted_worlds: []
permission: ''

你的第一个任务所需的东西 :

saving: ENABLED 为保存任务进度的方式, 共有以下三种:

  • ENABLED
  • SERVER_EPHEMERIAL
  • PLAYER_EPHEMERIAL

请暂时设置为 ENABLED,因为 SERVER_EPHEMERIAL 和 PLAYER_EPHEMERIAL 用于 特殊情况. 一般来说, ENABLED 会保存所有进行中的任务到数据库内, SERVER_EPHEMERIAL 会保存任务直至服务器重启/重载, PLAYER_EPHEMERIAL 保存任务直至玩家离线.

name: '示例任务' 为可视的任务名. 你需要注意的是这个名字不能用于指令. 这和任务 id 不同(.yml的文件名).

description: 任务描述.

max_concurrent_instances: -1 可设置数值,限制全服玩家可同时进行的任务数. 用于与NPC有关的任务, 因为每个玩家都可以和同一个NPC交互来接受任务. 设置为-1 关闭限制.

你也可以更改其他你想要更改的参数.

菜单设置

敬请期待...(咕咕咕)


任务分支

分支为任务的核心. 它包含了设置任务"路径"的目标,你可以用此为任务设置路线抉择或第二个任务目标.

不仅如此, 你可可以用于简洁任务. 何为此言? 如果你在一个任务分支内拥有500个不同抉择的路线,这也许看起来十分复杂且不易于理解.所以 从头开始理清思路很重要.

任务分支Wiki页面(建议阅读) : https://github.com/PYRRH4/QuestCreator/wiki/Quest-branches

开始任务你需要复制粘帖以下内容 :

branches:
  main:
    name: '万物之源'
    auto_start: true
    starts_at: START_OBJECT
    objects:
      START_OBJECT:
        ...
      OBJECT_NAME_THAT_I_WANT:
        ...

所以在这里,我们创建了告诉插件任务存在路径且有要完成的目标的主要分支.

main 为主分支的id, 你可以随意更改id :

branches:
  main_branch:
    ...

可以这样

branches:
  this_is_the_main_branche_with_a_super_dupper_long_name:
    ...

也可以这样

branches:
  tapioca:
    ...

还可以这样

分支就像任务中特殊的路径. 如果在任务的后期,你想把任务分为完全不同的抉择,那么你可以为每个抉择路线创建一个分支,从而“拥有一个干净的配置”。例如:

branches:
  main:
    name: 'Meh !'
    auto_start: true
    starts_at: START_OBJECT
      objects:
        START_OBJECT:
          ...
        ... bla, bla, bla, some objects
        ... and later here we offer a choice to the player. Depending on his choice, we'll either start branch 'choice_tapioca' or 'choice_arabicca'
  choice_tapioca:
    name: 'The tapioca branch'
    auto_start: false (since we don't want this branch to start when the quest begins but only if the player choose tapioca)
    starts_at: START_OBJECT
      objects:
        ...
  choice_arabicca:
    name: 'The arabicca branch'
    auto_start: false (since we don't want this branch to start when the quest begins but only if the player choose tapioca)
    starts_at: START_OBJECT
      objects:
        ...

但这不是必须的,这取决于你是否在一个分支内塞入了大量内容, 我个人推荐你创建更多的分支... 如果你创建了有大量选择和目标的大型任务, 你就会指定你必须要建立分支来使任务更加明确.

让我们深入了解一个分支的结构.

一个分支有3个参数和1个 'box' (目标box).

第一个参数为 name: 'whatever_you_want', 这是可以输入 /quest progress 看到的分支名.

第二个参数为 auto_start: true 正如我之前所说,你可以建立多个分支. 如果你设置为true, 这个分支会在任务开始时开始, 如果设置为false,这个分支可以在你想要开始的时间开始.

最后一个参数为 starts_at: name_of_the_object, 这可以设置开始分支的任务目标.


目标

如果你了解了分支的使用方法的话,让我们继续了解目标吧.

目标的概念

正如在教程开头所说, 任务目标分为两类, 玩家和服务器.

我们这里所说的目标实际上是任务的步骤,它是玩家所遵循的路径

目标可以用分支的方式运行 (也就是最常用到的地方) and more objects can be specified in two cases, if the player succeeds or fails the quest, but that'll be explained later. Let's focus on objects in branches for now.

目标的Wiki页面 : https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects

玩家目标

玩家目标是玩家在整个任务中必须完成的目标和行为。一个任务中可以有多个玩家目标

PLAYER_BED_ENTER #玩家必须睡觉才能完成这个目标
PLAYER_BLOCK_INTERACT #玩家必须与一个方块交互才能完成目标
PLAYER_JUMP #玩家必须跳跃才能完成目标
... 等等, 还有更多的目标类型. 详情查看目标wiki页面.

服务器目标

服务器目标为在任务过程中由服务器执行的行为. 一个任务中可以有多个服务器目标.

SERVER_COMMANDS_PERFORM #以服务器身份执行指令
SERVER_ITEM_GIVE #以服务器身份给予玩家物品 
SERVER_ITEM_REMOVE #以服务器身份删除一个物品 (比如: 任务结束时删除任务物品)
... 等等, 还有更多的目标类型. 详情查看目标wiki页面.

目标用法和设置

如果你想要在任务内鼠标目标,你必须明白如何编写和构建目标.

首先要设置的是目标名

举个例子, 你想要设置与NPC谈话的目标, 你必须先给目标起名.

和分支名一样,可随意设置名称.

1
或
TALK_TO_SOMEONE
或
TALK_TO_NPC
或
STEP-1
或
STEP_1_WHERE_I_HAVE_TO_TALK_TO_AN_NPC
或
THENAMEOFTHEOBJECTIN1WORDLINE
... 等

给第一个目标起名吧

现在你需要输入目标名. 像这样 :

    TALK_TO_SOMEONE:
    type: PLAYER_NPC_INTERACT

现在插件知道了 TALK_TO_SOMEONE 是用来干什么的了. 这个类型将会用于玩家目标且这个目标为NPC_INTERACT·与NPC交互.

你也可以看到,告诉插件 TALK_TO_SOMEONE 是一个 PLAYER_NPC_INTERACT 的类型仍然不够,插件不知道其他事情,你需要给目标添加参数.

就像这样:

      TALK_TO_SOMEONE:
        type: PLAYER_NPC_INTERACT
        item:
          type: DIAMOND
          amount: 32
          must_have_in_hand: true
          remove_after_action: true
        npc: 15
        amount: 1

让我解释了添加了什么.

我们添加了3个东西 : item, npc 和 amount

让我们先从NPC开始吧:

npc: 15 为必填参数, 你需要在这里填写需要玩家交互的NPC的id.

item: 为可选参数,你可以在这里设置需要玩家交给NPC的物品.这个物品会在完成任务时被删除

特殊的是 item: 拥有独立的参数. 所以任务目标参数也可以拥有独立的参数, 就像 location:, 之后我们再深入研究...

最后是 amount: 1 ,该目标需要完成几次才能视为完成该目标 (在这个例子中则是玩家需要与NPC交互多少次).

总结一下我们做了什么:

  • 我们创建了一个名为TALK_TO_SOMEONE的目标
  • 输入 PLAYER_NPC_INTERACT
  • 我们需要让玩家与id为15的NPC交互, 并且这只能完成一次
  • 文件需要手持32个钻石并点击NPC

你认为还有太多的参数要学习 ? 别担心 ! 每个参数和设置都在这里 : https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects

你成功地创建了正确的任务目标

* 但是请等一下, 我们遇到了问题 ! 这也是你经常会因为粗心编辑而遇到的问题.

我们有目标了,但是现在我们将干什么?

正如我1之前所说,目标就像任务的路径,它们必须要链接起来才能形成一条路.

所以让我们谈谈目标 TALK_TO_SOMEONE .

让我们以这种形式写下配置 :

      TALK_TO_SOMEONE:
        type: PLAYER_NPC_INTERACT
        item:
          type: DIAMOND
          amount: 32
          must_have_in_hand: true
          remove_after_action: true
        npc: 15
        amount: 1
      THIS_SOMEONE_TALKS_TO_YOU:
        type: SERVER_MESSAGE_LIST
        messages:
          - '你好啊'
          - 'WAIT 3'
          - '你刚刚给了我32颗钻石, 我很开森'
          - 'It''s the minimum to talk to ya no ?'
          - 'WAIT 5'
          - '&cLove red color m8'

我创建了新的名为THIS_SOMEONE_TALKS_TO_YOU,类型为SERVER_MESSAGE_LIST 的任务目标。然后设置参数 messages: . 你可以在这里看到其他的任务目标: https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects

  • 耶 ! 你完成了另一个目标, 但是怎么把多个目标链接起来呢 ? *

**我们需要使用最后一个参数 : goto:

和路径一样, 你需要告诉插件在这个目标完成后将去哪里, 而你就需要用到 goto:

 :
      TALK_TO_SOMEONE:
        type: PLAYER_NPC_INTERACT
        item:
          type: DIAMOND
          amount: 32
          must_have_in_hand: true
          remove_after_action: true
        npc: 15
        amount: 1
        goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
      THIS_SOMEONE_TALKS_TO_YOU:
        type: SERVER_MESSAGE_LIST
        messages:
          - '你好啊'
          - 'WAIT 3'
          - '你刚刚给了我32颗钻石, 我很开
          - 'It''s the minimum to talk to ya no ?'
          - 'WAIT 5'
          - '&cLove red color m8'
        goto: QUEST_SUCCESS

goto: 是一个独特且必要的参数, 永远不要忘记在每个目标的最后一行加上goto, 除了一些罕见的个例外 (稍后解释).

它可以使用如 QUEST_SUCCESS 或 QUEST_FAIL 等多种参数,但先让我们看看我们写了什么配置 (更多可用数值位于QuestCreator/任务目标

添加了 goto: 后, 我们告诉了插件 TALK_TO_SOMEONE 已完成,该任务将前往任务目标: THIS_SOMEONE_TALKS_TO_YOU ,当 THIS_SOMEONE_TALKS_TO_YOU 目标完成后 (也就是说消息列表内的每一行都已显示), 插件会前往 QUEST_SUCCESS (结束任务的一种方式, 标记为已完成的任务).

:

We now have a path where you will have to speak to the NPC 15, with 32 diamonds in hand that will disappear once you clicked, and once you clicked on him he will start to say to you strange things with strange delays between each line and a colored line at the ending.

Ta-daaam ! You created your first working path of quest ! It will be the most important things you will have to write in the YAML of your quests.

深入了解任务目标

我们现在掌握了很多创建任务的工具, 接下来我们将应用这些工具来创建一个完整的任务. 但我首先要说的是But firstly I want to explain you some little things about objects that you will have to understand to create optimized and clean objects.

任务目标有强制和可选参数.

强制参数经常指定你复制粘帖的任务目标,详情查看 : QuestCreator/任务目标

但可选参数不在任务目标类型内. 他们在此页上方.

以如下方式获取 :

name (可选) 为任务目标名. 举个例子 : "Break 10 cobblestone on the ground"
progress_name (可选)为任务目标名缩写. 这会被用于菜单或 /quest progress 指令内. 如 : "Break cobblestone"
message ((可选) 为在任务目标开始时发送的文本.
sound (可选) 为玩家接受任务发出的音效.
post_message (可选) 为任务目标结束后发送的文本.
post_sound (可选) 为任务目标结束后发出的音效. location 为任务目标的地点设置 (详情请看下面).

地点设置对一些任务目标很有用.

让我来解释怎么使用地点设置吧 !

以下为示例设置.

      CRAFT_A_PICKAXE:
        type: PLAYER_ITEM_CRAFT
        item:
          type: DIAMOND_PICKAXE
          amount: 1
        name: '制作一把钻石镐'
        progress_name: 'Craft diamond pickaxe'
        message: '&a这是任务最开始的时候发送的消息! 请制作一把钻石镐.'
        sound:
          type: VILLAGER_IDLE
          volume: 1.0
          pitch: 1.0
        post_message: '&a你成功地制作了一把钻石镐 !'
        post_sound:
          type: LEVEL_UP
          volume: 1.0
          pitch: 1.0
        location:
          base: world,100,70,100
          near: 10
        goto: QUEST_SUCCESS

让我来解释以下这些东西,

我添加了任务名、进度名、消息、音效、结束消息、结束音效和地点. 这些是可选选项 (除了需要用到地点的任务目标).

这意味着什么 ? 这意味着你可以把这些东西放入每一个任务目标内使用. 这些选项称为 "常规设置".

name 用于如 /任务进度和其他插件的功能.
progress_name 会用于 /quest progress 和任务菜单物品. message 为图形化设置, 在任务开始时显示. 可添加多行带有颜色的消息.
sound 和消息一样设置
post_message也是一项常规设置,在任务目标结束后显示消息
post_sound 同上,在任务目标结束后发出音效

地点设置可用于大多数地方.

以下是一些示例.

最初的任务目标 :

      object:
        type: PLAYER_ITEM_DROP
        item:
          type: DIAMOND_PICKAXE
        amount: 1

带有地点设置的任务目标 :

      object:
        type: PLAYER_ITEM_DROP
        item:
          type: DIAMOND_PICKAXE
        amount: 1
        location:
          base: world,100,70,100
          near: 10

... 如果我想要玩家在指定范围的区域内丢弃一个钻石镐. 如果玩家在此范围外丢弃则无效.

所以地点设置可用于精确的任务行为.

可用于这个目标 :

      object:
        type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
        schematic_file: 'schematic_file.schematic'

在这个示例中插件会粘帖一个schematic文件, 但你知道 WorldEdit 和地点设置有关. 所以你需要设置粘帖的地点.

      object:
        type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
        schematic_file: 'schematic_file.schematic'
        location:
            base: world,123,13,543

这样你就可以看到插件粘帖建筑到哪里了 !

常见错误和需要知道的东西

错误

一个目标 = 一个目标类型. 你无法把两个目标类型放到一个目标内,你必须创建两个不同的目标并用goto连接

错误配置 :

      OBJETC_1:
        type: SERVER_MESSAGE_LIST
        messages_sound: VILLAGER_IDLE
        messages:
        - '&f[Système de survie] Objectif actualisé : Rendez vous à Oneill en [-1227,180,2715] et donner au [Gérant d''Oneill] le [FRET]'
        name: 'dialogue2'
        progress_name: ''
        message: ''
        sound: VILLAGER_IDLE
        post_message: ''
        post_sound: VILLAGER_IDLE
        type: PLAYER_NPC_INTERACT
        item:
          type: PISTON
          amount: 1
          name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
          must_have_in_hand: false
          remove_after_action: true
        npc: 256
        name: 'DONNER_FRET_ONEILL'
        progress_name: ''
        message: ''
        sound: VILLAGER_IDLE
        post_message: ''
        post_sound: VILLAGER_IDLE
        goto: OBJECT OBJECT_2

正确配置 :

      OBJECT_1:
        type: SERVER_MESSAGE_LIST
        messages_sound: VILLAGER_IDLE
        messages:
        - '&6Well played.'
        - 'WAIT 2'
        - '&f[生存系统] 新的任务目标 : &a前往 &l[-1227,180,2715] 的奥尼尔&a并给予 &l[F.R.E.T] &a &l[Oneill Manager]&f.'
        name: '[dialogue]'
        progress_name: '[dialogue]'
        message: ''
        sound: VILLAGER_IDLE
        post_message: ''
        post_sound: VILLAGER_IDLE
        goto: OBJECT OBJECT_2
      OBJECT_2:
        type: PLAYER_NPC_INTERACT
        item:
          type: PISTON
          amount: 1
          name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
          must_have_in_hand: false
          remove_after_action: true
        npc: 256
        name: 'Give the FRET to the Oneill Manager'
        progress_name: 'Give FRET to Oneill Manager'
        message: ''
        sound: VILLAGER_IDLE
        post_message: ''
        post_sound: VILLAGER_IDLE
        goto: OBJECT OBJECT_3

在输入文本信息post_message等消息时请使用''. 比如: message: 'I love tapioca' 而不是 message: I love tapioca. (虽然有时候这样也能用,但仍推荐加上引号)

也不要忘记加上两个 ' when you want to put one '. 比如: I''ll want you''re tapioca when he''ll want it (YAML书写基础规则)

不要忘记设置链接目标. goto: OBJECT A_THING_WITH_A_COOL_NAME and not goto: A_THING_WITH_A_COOL_NAME

需要知道的事:

在一个 item 参数内你可以像这样添加子参数 :

      object:
        type: SERVER_ITEM_GIVE
      item:
        type: PISTON
        name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
        amount: 1

有两种你可以在编写任务时使用的 amount: . 这两者有些不同.item内的是物品数

:
      object:
      type: SERVER_ITEM_GIVE
      item:
        type: PISTON
        name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
        amount: 1
      amount: 2

第一个 amount: in the item is the number of items that will be given to the player. The second amount: in the object, written under the type and the item parameters, is the amount of time this action will be repeated. Can be useful if you want the player to do one object multiple times. I let you imagine what you can do with this feature.

如果你在编辑任务时遇到问题并且卡住, 那么你就有可能犯了语法错误,首先确保你使用支持YAML的编辑器,比如notepad++

检测你的YAML格式是否规范.

总结

复习以下你刚学到的知识吧 !

:
saving: ENABLED
name: 'Example Quest'
description:
  - '&7Just a sample quest'
max_concurrent_instances: -1
max_concurrent_instances_queue: true
min_players: 1
max_players: 1
max_completions: 1
time_limit: 0
cooldown: DISABLED
actionbar: ''
send_status_message: true
send_objective_update_message: true
restricted_worlds: []
permission: ''

任务分支:

branches:
  main:
    name: 'main'
    auto_start: true
    starts_at: START_OBJECT
      objects:
        ...

和任务目标:

      TALK_TO_SOMEONE:
        type: PLAYER_NPC_INTERACT
        item:
          type: DIAMOND
          amount: 32
          must_have_in_hand: true
          remove_after_action: true
        npc: 15
        amount: 1
        goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
      THIS_SOMEONE_TALKS_TO_YOU:
        type: SERVER_MESSAGE_LIST
        messages:
          - 'Yeah man I''m talking to ya'
          - 'WAIT 3'
          - 'You just gave me 32 diamonds, now I feel happy'
          - 'It''s the minimum to talk to ya no ?'
          - 'WAIT 5'
          - '&cLove red color m8'
          goto: QUEST_SUCCESS

和—— FUUSSIIOONN :

saving: ENABLED
name: 'Example Quest'
description:
  - '&7Just a sample quest'
max_concurrent_instances: -1
max_concurrent_instances_queue: true
min_players: 1
max_players: 1
max_completions: 1
time_limit: 0
cooldown: DISABLED
actionbar: ''
send_status_message: true
send_objective_update_message: true
restricted_worlds: []
permission: ''
branches:
  main:
    name: 'main'
    auto_start: true
    starts_at: START_OBJECT
    objects:
      TALK_TO_SOMEONE:
        type: PLAYER_NPC_INTERACT
        item:
          type: DIAMOND
          amount: 32
          must_have_in_hand: true
          remove_after_action: true
        npc: 15
        amount: 1
        goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
      THIS_SOMEONE_TALKS_TO_YOU:
        type: SERVER_MESSAGE_LIST
        messages:
          - 'Yeah man I''m talking to ya'
          - 'WAIT 3'
          - 'You just gave me 32 diamonds, now I feel happy'
          - 'It''s the minimum to talk to ya no ?'
          - 'WAIT 5
          - '&cLove red color m8'
          goto: QUEST_SUCCESS

干得漂亮,你成功地完成了第一个任务的编辑! 你可以看到,与NPC交互等功能使得这个任务已经有点复杂了.

现在你获得了创建任务的基础知识. 你还需要进行测试、联系才能使你对任务的编辑运筹帷幄. 突破思维的束缚 : 一切皆有可能.

如果你遇到了问题且经过检查后找不到问题所在,你可以加入discord寻求帮助 !

你也可以在discord里分享你的任务和任务机制 ! ^_^

感谢阅读这篇教程 ! (提醒 : 为编写了这篇教程的 Lordinouille 点赞 !)

现在是你的回合了. 插件等待你探索 : 任务的创建取决于你 !