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

QuestCreator/创建任务

来自Minecraft插件百科
Qsefthuopq讨论 | 贡献2019年3月9日 (六) 18: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.