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

QuestCreator/创建任务:修订间差异

来自Minecraft插件百科
跳转到导航 跳转到搜索
(创建页面,内容为“{{qcbox}} = 创建任务 = === 提醒 (十分重要 !) === * 这个页面解释了如何配置任务文件. 即使你打算使用游戏内的任务编辑器,你也…”)
 
无编辑摘要
第10行: 第10行:
* ''每一个'' 任务设置、分支、目标、条件、地点、方块、材料等, 可以是 "raw" 数值,你也可以设置全局变量(<code>{gvariable:global_variable_name}</code>), QuestCreator variables (<code>{variable:variable_name}</code>) 和 PlaceholderAPI 变量 (<code>%my_placeholder%</code>). 变量取决于玩家并会在有需要时被解析. (如果是组队任务则为队长)
* ''每一个'' 任务设置、分支、目标、条件、地点、方块、材料等, 可以是 "raw" 数值,你也可以设置全局变量(<code>{gvariable:global_variable_name}</code>), QuestCreator variables (<code>{variable:variable_name}</code>) 和 PlaceholderAPI 变量 (<code>%my_placeholder%</code>). 变量取决于玩家并会在有需要时被解析. (如果是组队任务则为队长)
* 比如, 你可以设置 <code>base: world,%player_x%,50,%player_y%</code> 作为地点设置, 或 <code>amount: %heroes_level%</code> 作为数量设置. 同样可用于 goto, 比如 <code>goto: OBJECT {variable_goto}</code> 或 <code>goto: QUEST_{variable:mood}</code> !
* 比如, 你可以设置 <code>base: world,%player_x%,50,%player_y%</code> 作为地点设置, 或 <code>amount: %heroes_level%</code> 作为数量设置. 同样可用于 goto, 比如 <code>goto: OBJECT {variable_goto}</code> 或 <code>goto: QUEST_{variable:mood}</code> !
* 每个数值选项可以包含数学表达式, and other settings can contain {math:[expression]}. Combined with placeholders, this is the ultimate way of customizing settings for every player ! It supports <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>sin</code>, <code>cos()</code>, <code>tan()</code>, <code>log()</code>, <code>ceil()</code>, <code>floor()</code> and can contain parentheses. For example, <code>amount: %heroes_level% * (5 + log(10^3))</code>.
* 每个数值选项可以包含数学表达式 {math:[expression]}. 和占位符一起使用效果更佳. 可使用 <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>sin</code>, <code>cos()</code>, <code>tan()</code>, <code>log()</code>, <code>ceil()</code>, <code>floor()</code> 和括号. 比如, <code>amount: %heroes_level% * (5 + log(10^3))</code>.
* Every setting can contain a trienal permission condition, such as {permission:my_permission,value_if_has,value_if_hasnt}. The result depends on the player permissions : if he has the specified permission, it'll use the first value, otherwise the second one. Those two available values can also contain placeholders !
* 每个设置可以包含多个权限条件, 比如 {permission:my_permission,value_if_has,value_if_hasnt}. 结果取决于玩家的权限 : 如果玩家拥有特定权限, 将采用第一个数值,无权限则使用第二个数值. 这两个数值可以加入占位符 !
* It's parsed in real-time, but there's a cache so it doesn't demand too much server resources. Plus, objects goals are parsed when they begin (will not change until completion).
* 实时解析, 并且缓存可以减少占用服务器资源. Plus, objects goals are parsed when they begin (will not change until completion).
* The <code>type: ...</code> settings for objects, conditions and activators are the only settings that can NOT contain variables and will NOT be parsed.
* The <code>type: ...</code> settings for objects, conditions and activators are the only settings that can NOT contain variables and will NOT be parsed.


第18行: 第18行:
----
----


=== Example quest ===
=== 示例任务 ===
Here's the default example quest generated (the one for 1.13). You should take a quick look at it to try to understand the general idea of how it works.
以下为默认生成的示例任务 (1.13). You should take a quick look at it to try to understand the general idea of how it works.


The 'section' at the top of the file is for basics and misc settings.
'section' at the top of the file is for basics and misc settings.


The "gui" section is for the GUI items appearance.
The "gui" section is for the GUI items appearance.

2019年3月9日 (六) 10:47的版本

创建任务

提醒 (十分重要 !)

  • 这个页面解释了如何配置任务文件. 即使你打算使用游戏内的任务编辑器,你也最好阅读以下内容以便于了解插件的运行方式和任务文件的结构.

每个玩家的任务都可以不同 ! 自从 QuestCreator v4版本后, 你可以编写 :

  • 每一个 任务设置、分支、目标、条件、地点、方块、材料等, 可以是 "raw" 数值,你也可以设置全局变量({gvariable:global_variable_name}), QuestCreator variables ({variable:variable_name}) 和 PlaceholderAPI 变量 (%my_placeholder%). 变量取决于玩家并会在有需要时被解析. (如果是组队任务则为队长)
  • 比如, 你可以设置 base: world,%player_x%,50,%player_y% 作为地点设置, 或 amount: %heroes_level% 作为数量设置. 同样可用于 goto, 比如 goto: OBJECT {variable_goto}goto: QUEST_{variable:mood} !
  • 每个数值选项可以包含数学表达式 {math:[expression]}. 和占位符一起使用效果更佳. 可使用 +, -, *, /, sin, cos(), tan(), log(), ceil(), floor() 和括号. 比如, amount: %heroes_level% * (5 + log(10^3)).
  • 每个设置可以包含多个权限条件, 比如 {permission:my_permission,value_if_has,value_if_hasnt}. 结果取决于玩家的权限 : 如果玩家拥有特定权限, 将采用第一个数值,无权限则使用第二个数值. 这两个数值可以加入占位符 !
  • 实时解析, 并且缓存可以减少占用服务器资源. Plus, objects goals are parsed when they begin (will not change until completion).
  • The type: ... settings for objects, conditions and activators are the only settings that can NOT contain variables and will NOT be parsed.

As said in the index page, all your quest configuration files will be in /plugins/QuestCreator/quests/. Every file that you create in this folder, ending with .yml, will be considered as a quest (you can organize your quests into subfolders if you want). The name of the file, without extension (.yml), will be the quest id, it's better not to put non-alphanumerical characters in it. Spaces are not allowed in file names.


示例任务

以下为默认生成的示例任务 (1.13). You should take a quick look at it to try to understand the general idea of how it works.

'section' at the top of the file is for basics and misc settings.

The "gui" section is for the GUI items appearance.

The "start_conditions" are things that the player needs to have to start the quest.

The "branches" section is for the quest branches, the different paths and objects that the player can do through his progress during the quest.

The "success_objects" are objects that will be executed if the player succeeds the quest, useful to set a generic ending dialog or animation, or give rewards for example. (optional)

The "fail_objects" are objects that will be executed if the player fails the quest, useful to reset things for example. (optional)

The "cancel_objects" are objects that will be executed if the quest gets cancelled, useful to reset things for example. (optional)

Some of those settings are detailed below in the comments, and some parts are detailed in other wiki pages.

If you create coop quests (so if max_coop_players is greater than 0), please take a look at those details :

  • Every variable change/node in the quest will refer to the variable values of the quest leader.
  • The choices will be sent to the quest leader.
  • Some objects will be executed for all players (sending a message, playing a sound, teleporting player, etc) and others will only be executing one time (teleporting an entity, placing a block, etc).

There also are two farm quest examples at the bottom of the page.