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

GuillaumeVDN的插件文档/QuestCreator/基础内容:修订间差异

来自Minecraft插件百科
跳转到导航 跳转到搜索
(创建页面,内容为“{{模板:VDNBox}} =视频= ==QuestCreator介绍(英语)== 我制作的这个视频涵盖了大多数核心特性的介绍。如果你是刚使用这款插件,…”)
 
无编辑摘要
第16行: 第16行:
这一部分描述了 /plugins/QuestCreator/ 内的文件结构。
这一部分描述了 /plugins/QuestCreator/ 内的文件结构。
==配置==
==配置==
The main configuration file is /config.yml, it contains a few useful settings. Everything is explained inside that file with comments.
主要的配置文件是/config.yml,该文件包含了不少有用的设置。文件内的注释详细地解释了每一个选项。


You can configure user, server and global variables in their respective .yml files.
你可以在对应的.yml文件内配置用户、服务器和全局变量。


You can download the default configuration files to take a look.
[http://guillaumevdn.com/plugins/doc/files/default_configs_qc_v6.zip 点击下载默认配置文件]
==元素存储位置==
==元素存储位置==
All elements (quest models, quest pools, GUIs, global branches, global objects, …) are stored in their own folders :
所有元素(任务模型、任务池、GUI、全局分支、全局目标等)都存储在对应的文件夹内:
* /quest_activators/
* /quest_activators/
* /quest_models/
* /quest_models/
第34行: 第34行:
* /global_objects/
* /global_objects/
* /global_time_frames/
* /global_time_frames/
在每个文件夹里,每个元素都是一个 .yml格式的为文件。比如,/quest_models/my_quest.yml 是id为my_quest的任务模型。Id对于大小写敏感(须小写)。
在每个文件夹里,每个元素都是一个 .yml格式的文件。比如,/quest_models/my_quest.yml 是id为my_quest的任务模型。id对于大小写敏感(须小写)。


你也可以创建子文件夹来更清晰地给文件分类。
你也可以创建子文件夹来更清晰地给文件分类。
==数据==
==数据==
If you’re using JSON as a back-end for data boards, data files will be saved under /plugins/QuestCreator/data_v6/. Removing that folder will discard all current user data (active quests, history, user variables, etc). It should be noted that quest points are stored in GCore’s statistics system, located with JSON under /plugins/GCore/data_v8/statistics/.
如果你使用JSON作为数据板的后端,数据文件将保存在/plugins/QuestCreator/data_v6/下。删除该文件夹将导致所有当前用户数据的丢失(活跃中的任务、任务历史、用户变量等)。需要注意的是,任务点数存储在GCore的数据统计系统中,在/plugins/GCore/data_v8/statistics/下以JSON的形式存储。
=任务介绍=
=任务介绍=
==任务模型==
==任务模型==
The first thing to note is the difference between “quests” and “quest models”.
你最先需要区分的概念就是“任务”和“任务模型”。


A “quest model” is a configuration file that contain all the configuration and possibilities that will (or might) happen during the quest. They’re located under /quest_models/.
“任务模型”是配置文件,其包含在玩家进行任务时可能会遇到的种种可能性相关的配置。任务模型位于/quest_models/


A “quest” represents an active quest model. Each player (or group of players for cooperation) might or might not have a “quest” instance with different choices and progression.
“任务”代表活跃中的任务模型。每名玩家(或多名组队玩家)可能会有不同选择和进度的“任务”实例。
==理解分支和目标==
==理解分支和目标==
A running quest has always at least one active “branch” with an active object inside. Each branch can be seen as a “container of objects”.
进行中的任务至少拥有一个已激活的“分支”以及分支内的目标。你可以将分支视作“任务目标的容器”。


A quest object represents either :
任务目标代表以下两者:


* An objective that the player must complete (typically, to progress to the next part of the quest)
* 玩家必须完成的任务对象
* Or an action the server must do (for instance, sending messages, playing sounds, manipulating entities, stuff like that).
* 或是服务器必须执行的操作(比如发送消息、播放音效、操控实体等)
In a quest, there is only one active object per branch at a time, but you can have multiple running branches.
在任务中,虽然每个分支只有一个活跃的目标,但你可以给任务设置多个分支。


Here’s a scheme (not actual config) of one possible structure of an active quest :
以下是一份活跃任务可能的配置结构草稿(并不是实际的配置):
  my_active_quest:
  my_active_quest:
   branch_1: *active
   branch_1: *active
第70行: 第70行:
     - object_3
     - object_3
      
      
In the quest model, there are 3 available branches, but only 2 of them are active in the player’s quest. In each of those two branches, there are many possible objects, but only one is currently active in each branch.
在任务模型中共有3个分支,但只有2个分支活跃在玩家的任务中。在这2个分支里有很多种可能的目标,但在每个分支中只有一个是活跃的目标。
==实践==
==实践==
Let’s translate our example into the actual configuration settings of a quest model :
让我们将理论付诸于实践吧:




第81行: 第81行:
     objects:
     objects:
       object_1:
       object_1:
         # ... object settings go here
         # …… 此处省略目标设置
       object_2:
       object_2:
         # ... object settings go here
         # …… 此处省略目标设置
       object_3:
       object_3:
         # ... object settings go here
         # …… 此处省略目标设置
       object_4:
       object_4:
         # ... object settings go here
         # …… 此处省略目标设置
   branch_2:
   branch_2:
     starts_directly: true
     starts_directly: true
第93行: 第93行:
     objects:
     objects:
       object_1:
       object_1:
         # ... object settings go here
         # …… 此处省略目标设置
       object_2:
       object_2:
         # ... object settings go here
         # …… 此处省略目标设置
   branch_3:
   branch_3:
     starts_directly: false
     starts_directly: false
第101行: 第101行:
     objects:
     objects:
       object_1:
       object_1:
         # ... object settings go here
         # …… 此处省略目标设置
       object_2:
       object_2:
         # ... object settings go here
         # …… 此处省略目标设置
       object_3:
       object_3:
         # ... object settings go here
         # …… 此处省略目标设置
Lot of information here, it mixes the different concepts we’ve seen so far.
这份配置里有很多信息,这些信息混淆了我们迄今谈到的不同概念。


Each branch under the branches configuration section represents a possible branch, with an identifier (branch_1, branch_2, …) that must be unique.
分支配置下的每个分支都代表一个可能的分支,它们拥有不一样的辨识符(branch_1、branch_2……)。


The starts_directly boolean setting for each branch is used to indicate whether this branch should start automatically when the quest starts, or not (like we did for branch branch_3) if you would like to start it later manually.
The starts_directly boolean setting for each branch is used to indicate whether this branch should start automatically when the quest starts, or not (like we did for branch branch_3) if you would like to start it later manually.
第124行: 第124行:
So, let’s add goto’s to our branch branch_1 :
So, let’s add goto’s to our branch branch_1 :
  object_1:
  object_1:
   # ... object settings go here
   # …… 此处省略目标设置
   goto: OBJECT object_4
   goto: OBJECT object_4
  object_2:
  object_2:
   # ... object settings go here
   # …… 此处省略目标设置
   goto: OBJECT object_1
   goto: OBJECT object_1
  object_3:
  object_3:
   # ... object settings go here
   # …… 此处省略目标设置
   goto: OBJECT object_2
   goto: OBJECT object_2
  object_4:
  object_4:
   # ... object settings go here
   # …… 此处省略目标设置
   goto: OBJECT object_1
   goto: OBJECT object_1
This respects the order of our example : object_3 > object_2 > object_1 > object_4 > object_1 > object_4 > ..., even though here the loop between object 1 and 4 will never stop because we didn’t set any conditions. Conditions and logic are explained further in this documentation, but this example is given to clearly explain the power of goto’s.
This respects the order of our example : object_3 > object_2 > object_1 > object_4 > object_1 > object_4 > ..., even though here the loop between object 1 and 4 will never stop because we didn’t set any conditions. Conditions and logic are explained further in this documentation, but this example is given to clearly explain the power of goto’s.
第145行: 第145行:
     objects:
     objects:
       object_1:
       object_1:
         # ... object settings go here
         # …… 此处省略目标设置
         goto: OBJECT object_2
         goto: OBJECT object_2
       object_2:
       object_2:
         # ... object settings go here
         # …… 此处省略目标设置
         goto: BRANCH branch_3
         goto: BRANCH branch_3
Once object 2 is completed, the goto will start our branch_3 branch. And since the goto of branch_2 did not call an object from the same branch, branch_2 will be stopped because it wouldn’t know what to do next in the same branch. Don’t worry, there are ways to start other branches without stopping the current one, but again, this is just for example’s sake.
Once object 2 is completed, the goto will start our branch_3 branch. And since the goto of branch_2 did not call an object from the same branch, branch_2 will be stopped because it wouldn’t know what to do next in the same branch. Don’t worry, there are ways to start other branches without stopping the current one, but again, this is just for example’s sake.

2020年11月23日 (一) 10:57的版本

GuillaumeVDN的插件文档
页面

GuillaumeVDN的插件文档 · 迁移

所有插件都有的常见内容

配置 · 杂项 · 关联

QuestCreator

基础内容 · 示例 · 详细特性 · 高级内容 · 关联

视频

QuestCreator介绍(英语)

我制作的这个视频涵盖了大多数核心特性的介绍。如果你是刚使用这款插件,那么我推荐你从头看到尾。在视频下方的描述里写有了时间点,你可以根据需求跳到特定的时间点观看。

https://www.youtube.com/watch?v=5Lwh9qGReVk

QuestCreator介绍(西班牙语)

maxmar628用西班牙语介绍了QuestCreator。

https://www.youtube.com/watch?v=ARukGd7m5zc

QuestCreator介绍(英语)

InkBat制作的介绍任务结构的视频。这个视频有一段时间了,因此配置部分和现在的已截然不同。

https://www.youtube.com/watch?v=KjZ9gaJlObI

文件结构

这一部分描述了 /plugins/QuestCreator/ 内的文件结构。

配置

主要的配置文件是/config.yml,该文件包含了不少有用的设置。文件内的注释详细地解释了每一个选项。

你可以在对应的.yml文件内配置用户、服务器和全局变量。

点击下载默认配置文件

元素存储位置

所有元素(任务模型、任务池、GUI、全局分支、全局目标等)都存储在对应的文件夹内:

  • /quest_activators/
  • /quest_models/
  • /quest_models_functional/
  • /quest_groups/
  • /quest_pools/
  • /guis/
  • /global_branches/
  • /global_conditions/
  • /global_gui_items/
  • /global_objects/
  • /global_time_frames/

在每个文件夹里,每个元素都是一个 .yml格式的文件。比如,/quest_models/my_quest.yml 是id为my_quest的任务模型。id对于大小写敏感(须小写)。

你也可以创建子文件夹来更清晰地给文件分类。

数据

如果你使用JSON作为数据板的后端,数据文件将保存在/plugins/QuestCreator/data_v6/下。删除该文件夹将导致所有当前用户数据的丢失(活跃中的任务、任务历史、用户变量等)。需要注意的是,任务点数存储在GCore的数据统计系统中,在/plugins/GCore/data_v8/statistics/下以JSON的形式存储。

任务介绍

任务模型

你最先需要区分的概念就是“任务”和“任务模型”。

“任务模型”是配置文件,其包含在玩家进行任务时可能会遇到的种种可能性相关的配置。任务模型位于/quest_models/。

“任务”代表活跃中的任务模型。每名玩家(或多名组队玩家)可能会有不同选择和进度的“任务”实例。

理解分支和目标

进行中的任务至少拥有一个已激活的“分支”以及分支内的目标。你可以将分支视作“任务目标的容器”。

任务目标代表以下两者:

  • 玩家必须完成的任务对象
  • 或是服务器必须执行的操作(比如发送消息、播放音效、操控实体等)

在任务中,虽然每个分支只有一个活跃的目标,但你可以给任务设置多个分支。

以下是一份活跃任务可能的配置结构草稿(并不是实际的配置):

my_active_quest:
  branch_1: *active
    - object_1
    - object_2
    - *object_3
    - object_4
  branch_2: *active
    - *object_1
    - object_2
  branch_3: not active
    - object_1
    - object_2
    - object_3
    

在任务模型中共有3个分支,但只有2个分支活跃在玩家的任务中。在这2个分支里有很多种可能的目标,但在每个分支中只有一个是活跃的目标。

实践

让我们将理论付诸于实践吧:


branches:
  branch_1:
    starts_directly: true
    starts_at: object_3
    objects:
      object_1:
        # …… 此处省略目标设置
      object_2:
        # …… 此处省略目标设置
      object_3:
        # …… 此处省略目标设置
      object_4:
        # …… 此处省略目标设置
  branch_2:
    starts_directly: true
    starts_at: object_1
    objects:
      object_1:
        # …… 此处省略目标设置
      object_2:
        # …… 此处省略目标设置
  branch_3:
    starts_directly: false
    starts_at: object_2
    objects:
      object_1:
        # …… 此处省略目标设置
      object_2:
        # …… 此处省略目标设置
      object_3:
        # …… 此处省略目标设置

这份配置里有很多信息,这些信息混淆了我们迄今谈到的不同概念。

分支配置下的每个分支都代表一个可能的分支,它们拥有不一样的辨识符(branch_1、branch_2……)。

The starts_directly boolean setting for each branch is used to indicate whether this branch should start automatically when the quest starts, or not (like we did for branch branch_3) if you would like to start it later manually.

The objects section is a list of available objects for this branch, with an identifier that must be unique to the branch. But you can have multiple objects named object_1 as long as they’re in different branches (like in our example).

goto的重要性

Even though a branch has a ‘list’ of available objects, those objects might not follow the list order. For instance, in example above branch_1, you might decide that the branch will first run object_3 and then go to object_2.

The starts_at setting for each branch is used to indicate to the plugin at which object the branch should begin when started.

You could also repeat objects as many times as you want, for instance : object_3 > object_2 > object_1 > object_4 > object_1 > object_4 > ... and stop looping until a certain condition is met.

So, from what we’ve seen until here, to put it simply, let’s just say the plugin is not ‘smart enough’ to detect what object it should run next, because you’re actually freed from the ‘fixed list order’. You’ll have to indicate to the plugin what object it should run next, or more generally ‘what goto it should perform’.

So, let’s add goto’s to our branch branch_1 :

object_1:
  # …… 此处省略目标设置
  goto: OBJECT object_4
object_2:
  # …… 此处省略目标设置
  goto: OBJECT object_1
object_3:
  # …… 此处省略目标设置
  goto: OBJECT object_2
object_4:
  # …… 此处省略目标设置
  goto: OBJECT object_1

This respects the order of our example : object_3 > object_2 > object_1 > object_4 > object_1 > object_4 > ..., even though here the loop between object 1 and 4 will never stop because we didn’t set any conditions. Conditions and logic are explained further in this documentation, but this example is given to clearly explain the power of goto’s.

So here, you indicate with the OBJECT goto type that you wish to run an object of the same branch when the current object is completed. But goto’s can actually trigger more than objects, they can start or stop branches, complete the quest, manipulate other quests and stuff. See a list of goto types here

For instance, we have in our example a branch named branch_3 that doesn’t start automatically. At some point in our quest, we might want to start that branch ! We could do that at the end of the second branch :

  branch_2:
    starts_directly: true
    starts_at: object_1
    objects:
      object_1:
        # …… 此处省略目标设置
        goto: OBJECT object_2
      object_2:
        # …… 此处省略目标设置
        goto: BRANCH branch_3

Once object 2 is completed, the goto will start our branch_3 branch. And since the goto of branch_2 did not call an object from the same branch, branch_2 will be stopped because it wouldn’t know what to do next in the same branch. Don’t worry, there are ways to start other branches without stopping the current one, but again, this is just for example’s sake.

And finally, note that if there are no active branches (due to a missing goto somewhere), the quest stops because it doesn’t know what to do next.

简易示例

I’ve used kind of complicated examples until here so you could visualize the different concepts. Here’s a practical example of a simple NPC farm quest.

branches:
  unique_branch:  # this is a simple quest, so we just need one branch
    starts_directly: true  # this is actually true by default
    starts_at: START_NPC_DIALOG   # we start the quest by talking to the NPC
    objects:
      START_NPC_DIALOG:
        # ... our dialog settings go here
        goto: OBJECT FARM_STONE
      FARM_STONE:
        # ... our farming settings go here
        goto: OBJECT DELIVER_ITEMS_TO_NPC
      DELIVER_ITEMS_TO_NPC:
        # ... our NPC delivery settings go here
        goto: OBJECT END_NPC_DIALOG
      END_NPC_DIALOG:
        # ... our dialog settings go here
        goto: QUEST_SUCCESS  # this will stop the quest and mark is as successfully completed

Note : I know the goto’s system can be seen as annoying at first glance. Practically, especially for such simple quests, you’ll have your first object be the first of the list and your goto’s will actually follow the order of the list. But for more advanced quests, the goto’s brings the essential freedom you need to truly be able to perform dialogs, loops, logic, etc. QuestCreator wasn’t designed to be simple, but powerful. Don’t worry, you can easily get the hand of it with some patience :D

更多目标和模型设置

Obviously, there aren’t just branches and objects configured in our quest model, there are many others settings.

A detailed list of objects settings can be found here.

A detailed list of model settings can be found here.

激活器介绍

Now, you have a quest, right ? But how can the player start it ?

If you want, you can give them the permission to start quests via the /quest start [quest] command. You could also configure a GUI so they can see all the quests and manage it there.

But you could also want the quest to start when talking to a Citizens NPC, or when they enter a certain area, or just automatically.

That’s the main purpose of activators : to activate quests under certain conditions. They’re located under /quest_activators/.

It’s pretty simple to add an activator to a quest : just create the activator and the settings for it, and then add the activator to your quest model :

activators:
  - my_activator

If my_activator is a physical activator, the quest will start when the player interacts with it. Otherwise, it’ll just start when the activator’s conditions are respected.

Read more about activators and their settings here.

任务池介绍

You might want to make it so some of your quests are available daily or weekly, and change it every day/week.

This is where quest pools are useful. They’re located under /quest_pools/.

理解任务池处理方式

A quest pool doesn’t have direct control on the starting of quests. What it does is ‘processing’ the quests for each period (a period is ‘the current day/week/…’) : calculating which quests will be available during the period.

When the player connects, the pool will check if it has already processed its quests for the player during the current period. For instance, let’s say you have a daily period and GuillaumeVDN connects for the first time that day at 15:30. The pool will not yet have processed the quests for him ; however, player Notch who connected at 14:00 will already have his quests processed for the day.

Once the pool processed a player for the active period, it doesn’t do it again it until the next day (or until it’s manually reset through a command).

任务券

Unlike regular quest management, quest pools work with a ‘token’ feature for quests. When a pool processes its quests for a said period, it gives them tokens.

Then, when the player wants to start the quest (through an activator or a gui, for instance), the plugin detects if the quest is in a pool and if it has remaining tokens.

When the player starts the quest once, one token is ‘consumed’ (taken from the player). Once the player doesn’t have any tokens left, they won’t be able to start the quest until the pool reprocesses, in the next period.

For instance, for a daily period, if the token is consumed today at 18:30, no new tokens will be available until reprocessing when the next day starts, at midnight (or later tomorrow if the player is not online then).

任务池设置

Read more about pools and their settings here.

游戏内编辑器

Even though I personally like editing through YAML files (because of how you can have a more global view), you can edit almost everything with the in-game editor (open it with /qc edit).

However, I do advise you to read through the documentation once to get a general understanding of the plugin. The in-game editor just contains all the settings and provide tools to edit them, but it does not actually ‘explain’ anything (‘what are quest models’, ‘what are activators’, ‘how to do this’, etc). So it’s just better to understand all of this before getting into it !

All the settings are the exact same as editing through files. Everytime the depth increases (the amount of indentation in YAML), it’s another submenu that opens.

Every basic value will have an icon in the GUI and different click types are available. Everything specific to that setting, and all the actions you can do with it, are explained there.

Most enumeration settings (Citizens NPC, click type, block type, enchantments, etc) can be selected in a menu or quickly imported.

I advise you to try it out by yourself to get a general feel of it ^_^

Because of my custom YAML reader, the original file settings order and comments will be kept when the in-game editor overwrites the file, so you could also configure most of it through files and use the editor to import stuff, for instance items or locations.