插件手册:betonquest:快速教程

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
插件手册:betonquest:快速教程 [2019/02/01 06:05]
小小k酱 [从events和conditions开始]
插件手册:betonquest:快速教程 [2019/02/01 12:20] (当前版本)
小小k酱 [BetonQuest快速教程]
行 1: 行 1:
-====== BetonQuest快速教程 ======+====== 快速教程 Quick Start Tutorial ======
  
 (版本:2018-10-16 翻译:kjiang [[https://github.com/Co0sh/BetonQuest/blob/b18b2b1521d79e3020864808f1d5c59f39f28361/docs/04-Quick-start-tutorial.md|原文链接]]) (版本:2018-10-16 翻译:kjiang [[https://github.com/Co0sh/BetonQuest/blob/b18b2b1521d79e3020864808f1d5c59f39f28361/docs/04-Quick-start-tutorial.md|原文链接]])
行 23: 行 23:
 ===== 从events和conditions开始 ===== ===== 从events和conditions开始 =====
  
-现在你已大概了解一个简单的任务是什么样子的了,那么该怎么自己制作出一个类似的呢?为了更好地理解BetonQuest的运作原理,我们需要先从__//events事件//__和__//conditions条件//__开始入手:+现在你已大概了解一个简单的任务是什么样子的了,那么该怎么设计出一个类似的呢?我们先从__//events事件//__和__//conditions条件//__开始入手:
  
-(这个教程涉及到许多新概念,如果你在阅读途中遇到不懂的地方,建议你随时翻越[[插件手册:betonquest:基本概念|基本概念参考 Reference]]。) +==== 事件 Events ====
-==== Events ====+
  
-Let's just open _events.yml_ file inside the _default_ package. At the end add a new line:+我们先打开__default__文件夹中的__events.yml__文件,然后在后面加入新的一行:
  
-<code yaml [enable_line_numbers="true"]>+<file yaml events.yml>
 foo: message Hello world! foo: message Hello world!
-</code>+</file>
  
-This is an event instruction. BetonQuest will use it to determine what type of event it is and what exactly should it do. ''foo'' is the name, ''message'' is the type and ''Hello world!'' tells the message type what it needs to display. In this case, if you run ''foo'' event, it will display to you ''Hello world!'' message. Now save the file, issue **/q reload** command and run the event with **/q e {name} foo** command (''q'' is shortcut for ''quest'', ''e'' is shortcut for ''event'', ''{name}'' is your Minecraft name without the brackets and ''foo'' is the name of the event we've just created). It should show you white ''Hello world!'' message in the chat.+这是一条__//事件指令//__。BetonQuest会根据这个指令执行触发相应的__//[[插件手册:betonquest:基本概念#事件_events|事件Events]]//__。在这个例子中,''foo''是你对这个事件的命名(名为''foo''的事件);''message''是事件的类型,这个是[[插件手册:betonquest:事件列表#消息message|向玩家发送消息]];而''Hello world!''则是message事件的参数,也就是消息内容。当你执行这个''foo''事件,BetonQuest就会向你显示''Hello world!''消息。
  
-Let's create another event, more complicated one. ''teleport'' seems complicated enough. As you can read in the _Events list_, it needs a single argument, the location. Press F3 and check out your current location (it's shown on the left, three numbers, ''x''''y'' and ''z''). Now add in _events.yml_ another line:+现在保存这个文件,并输入**/q reload**命令重新加载。然后我们可以测试这个__//事件//__是否有效了:在游戏中输入**/q e {name} foo**命令(备注:''q''是''quest''的缩写,''e''是''event''的缩写,''{name}''填入你的Minecraft名字,''foo''则表示上面刚刚编写的''foo''__//事件//__。如果成功,那么玩家的聊天框就会显示''Hello world!''这一段消息。
  
-<code yaml [enable_line_numbers="true"]>+我们现在来试一试别的__//事件//__,就拿[[插件手册:betonquest:事件列表#传送teleport|传送]]''teleport''好了。只要你看过__[[插件手册:betonquest:事件列表|事件列表]]__,就知道这个传送事件需要一个座标作为参数。在游戏里按F3就可以看到你现在的座标(在左边,有三个数字分别代表''x''、''y''和''z''座标)。现在把这个座标写到__events.yml__文件的末尾: 
 + 
 +<file yaml events.yml>
 bar: teleport 100;200;300;world bar: teleport 100;200;300;world
-</code>+</file>
  
-and replace ''100'' with your ''x'' coordinate, ''200'' with ''y'' and ''300'' with ''z''''world'' needs to be replaced with your current world's name. Save the file, reload the plugin and run this event with a command described before. It should teleport you to the location you have specified.+记得把''100''改成你的''x''座标,''200''改为''y'',还有''300''改为''z''''world''改为你现在所在的世界(一般情况下就是world)。然后保存这个文件、重新加载BetonQuest(**/reload**)并照葫芦画瓢用上面的''/event {namne} bar''命令测试这个//事件//。如无意外,你会被传送到那个座标。
  
-Congratulations, you have just created your first events. Go ahead and do some experiments with other event types. You can find them in _Events list_ chapter. Once you're done let's start learning conditions.+现在恭喜你!你已经学会了怎么创建__//事件//__。你现在可以自己试试[[插件手册:betonquest:事件列表|事件列表]]中的其它事件。熟练之后我接着学习__//条件Conditions//__:
  
 ==== Conditions ==== ==== Conditions ====
  • 插件手册/betonquest/快速教程.1548972304.txt.gz
  • 最后更改: 2019/02/01 06:05
  • 小小k酱