|
|
(未显示同一用户的3个中间版本) |
第1行: |
第1行: |
| {{qcbox}}
| | #重定向 [[QuestCreator/教程]] |
| | |
| = 全面教程 =
| |
| 这个教程主要由 Lordinouille 编写(十分感谢 :D), 并由 PYRRH4 审核. 如果你想要购买这款插件或是想要了解如何使用这款插件的话这个教程就很有用.
| |
| | |
| 这个教程写于 QuestCreator v4.0.0 版本之前所有没有 'pseudo-scripting' 特点的解释.
| |
| | |
| 教程的第一个目的是学习如何使用文件创建一个任务. YAML 文件更加准确且你可以掌控更多东西. 但是如果你觉得配置文件很麻烦, 你完全可以使用游戏内的编辑器但还是建议你阅读这部分教程.
| |
| | |
| 请毫不犹豫地先看一下这一页面,这个页面包括了默认的示例任务文件, 你可以在这里看到"行为"的解释 : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Create-a-quest</nowiki>
| |
| | |
| 如果你对这部分内容不理解,你可以来discord服务器提问. 链接在插件页面 :)
| |
| | |
| === 任务之始 ===
| |
| 任务配置主要分成两部分, 设置和目标 :
| |
| | |
| * 设置为任务的常用参数, 你可以设置任务如何开始、完成任务所需时间、开始任务缩写权限、GUI菜单物品等.
| |
| * 目标按任务分支分组并被视为任务的不同路径目标和have to be seen as the differents paths and objectives of the quest. Objects are divided in 2 categories, PLAYER objects and SERVER objects.
| |
| | |
| 这两部分的详解请看下面.
| |
| ----
| |
| | |
| = 设置 =
| |
| ''设置的wiki页面 (建议阅读) : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Create-a-quest</nowiki>''
| |
| | |
| == 常用设置 ==
| |
| 位于文件开头 :
| |
| setting1: ...
| |
| setting2: ...
| |
| setting3: ...
| |
| 实际设置:
| |
| saving: ENABLED
| |
| name: 'Example Quest'
| |
| description:
| |
| <nowiki> </nowiki> - '&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: <nowiki>''</nowiki>
| |
| send_status_message: true
| |
| send_objective_update_message: true
| |
| restricted_worlds: []
| |
| permission: <nowiki>''</nowiki>
| |
| 你的第一个任务所需的东西 :
| |
| | |
| <code>saving: ENABLED</code> is the way your quest will stock data about your progress of the quest, there are 3 types of stockages :
| |
| | |
| * ENABLED
| |
| * SERVER_EPHEMERIAL
| |
| * PLAYER_EPHEMERIAL
| |
| | |
| Put it on ENABLEDfor the moment, because SERVER_EPHEMERIAL and PLAYER_EPHEMERIAL are for some ''specific cases''. Basically, ENABLED will save all running quests to disk/database, SERVER_EPHEMERIAL will save running quests until the server reloads/restarts, and PLAYER_EPHEMERIAL will save running quests until the player disconnects.
| |
| | |
| <code>name: 'Example Quest'</code> is the purely visual name. It's important to note that this is not the name that will be used in the commands. This is different than the quest id (which is the file name without the .yml extension).
| |
| | |
| <code>description:</code> purely visual again, you can put what you want.
| |
| | |
| <code>max_concurrent_instances: -1</code> is also case specific, it limits the maximum amount of running instances. It's mainly useful for quests that include NPC manipulation, since every player see and interact with the same NPCs (they are not client-side yet). Put it to ''-1'' to disable this limitation.
| |
| | |
| And you can modify the other parameters with what you actually want.
| |
| | |
| == GUI settings ==
| |
| ''Coming soon...''
| |
| ----
| |
| | |
| = Branches =
| |
| The branches are the core of your quest. They contain the objects that define the "paths" of the quest, so you have the possibility to create different paths (more in depth later), and detailed choices or secondary objectives for example.
| |
| | |
| More than that, it's a way of writing a ''clean quest''. Why ? Because let's say we have 500 lines with different choices that are all in the same branch, it'll look messy and won't be clean to read for you, even if "it still works fine". It's important to have a good and clean organisation ''from the beginning.''
| |
| | |
| ''Wiki page for branches (should read) : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-branches</nowiki>''
| |
| | |
| To start a quest you will need to copy paste this :
| |
| branches:
| |
| <nowiki> </nowiki> main:
| |
| <nowiki> </nowiki> name: 'It<nowiki>''</nowiki>s just the beginning'
| |
| <nowiki> </nowiki> auto_start: true
| |
| <nowiki> </nowiki> starts_at: START_OBJECT
| |
| <nowiki> </nowiki> objects:
| |
| <nowiki> </nowiki> START_OBJECT:
| |
| <nowiki> </nowiki> ...
| |
| <nowiki> </nowiki> OBJECT_NAME_THAT_I_WANT:
| |
| <nowiki> </nowiki> ...
| |
| So here, we create our main branch to basically tell the plugin that the path of the quest exists and that there will be stuff to do in our quest.
| |
| | |
| <code>main</code> is the id of your main branch, it's a chosen name so you can name it whatever you want :
| |
| branches:
| |
| main_branch:
| |
| ...
| |
| ''It works''
| |
| branches:
| |
| this_is_the_main_branche_with_a_super_dupper_long_name:
| |
| ...
| |
| ''It also works''
| |
| branches:
| |
| tapioca:
| |
| ...
| |
| ''It still works''
| |
| | |
| A branch is like a unique path in the quest. If later in the quest you want to divide the quest in 2 decisive and radically different choices, then you could, ''to have a clean config'', create one branch for each choice. For instance :
| |
| 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:
| |
| ...
| |
| But ''it's not mandatory'', it's up to you to have just one big branch with everything inside, but I personally advice you to create multiple branches... If you create big quests with a lot of choices and objectives, you'll see that it's almost mandatory to have a good and clear organisation.
| |
| | |
| Let's go deeper into the structure of a branch.
| |
| | |
| A branch has 3 parameters and one 'box' (the objects box).
| |
| | |
| The first parameter is <code>name: 'whatever_you_want'</code>, it's just a config name that will be visible in /quest progress.
| |
| | |
| The second parameter is <code>auto_start: true</code> as I said before, you could make multiple branches for like a big choice in your quest. If you set this to true, then the branch will start when the quest starts, and if it's set to false then the branch will only start if and when you choose to.
| |
| | |
| And the last parameter is <code>starts_at: name_of_the_object</code>, do not forget it, you will tell to the plugin at which object it will have to begin the branch objects.
| |
| ----
| |
| | |
| = Objects =
| |
| Now that you understand how the branches work, let's explain the objects.
| |
| | |
| == The concept of objects ==
| |
| As said at the beginning of this tutorial, objects are divided in 2 categories, PLAYER objects and SERVER objects.
| |
| | |
| What we call here objects are in fact the steps of the quest, it's the path followed by the player.
| |
| | |
| Objects can be run in branches (that's where they will be mostly used) 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 page for objects (should read) : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>''
| |
| | |
| === The PLAYER objects ===
| |
| The PLAYER objects are the objectives and actions the players has to do all along the quest. There can be multiple PLAYER objects in one quest.
| |
| PLAYER_BED_ENTER #the player will have to enter a bed to complete this object
| |
| PLAYER_BLOCK_INTERACT #the player will have to interact with a block to complete this object
| |
| PLAYER_JUMP #the player will have to jump to complete this object
| |
| ... and so on, there are lots of different object types. Check the wiki page about objects, they're all listed and detailed.
| |
| | |
| === The SERVER objects ===
| |
| The SERVER objects are the actions that will be executed by the server during the quest. Also there can be multiple SERVER objects in one quest.
| |
| SERVER_COMMANDS_PERFORM #the server will perform commands
| |
| SERVER_ITEM_GIVE #the server will give something to the player (ex: a quest item)
| |
| SERVER_ITEM_REMOVE #the server will remove an item (ex: once the quest is finished and you want to remove the quest item)
| |
| ... same for this, lots of different server object types. Check the wiki page about objects, they're all listed and detailed.
| |
| | |
| == Usage and settings of objects ==
| |
| If you want to use an object in your quest you will have to understand how to write them and how they are structured.
| |
| | |
| === An object is first defined by its name ===
| |
| For instance, let's say you want an object where you want to talk to an NPC, you will have to first give a name to the object that is going to be in charged to make you talk to the NPC.
| |
| | |
| It can be literally whatever you want, just as the branches.
| |
| 1
| |
| or
| |
| TALK_TO_SOMEONE
| |
| or
| |
| TALK_TO_NPC
| |
| or
| |
| STEP-1
| |
| or
| |
| STEP_1_WHERE_I_HAVE_TO_TALK_TO_AN_NPC
| |
| or
| |
| THENAMEOFTHEOBJECTIN1WORDLINE
| |
| ... and so on
| |
| Let's take the first name of the object
| |
| | |
| Now I have the name of my object I will need it's type. Because it's cool to name things, but we want it to execute an action or give an objective So let's write :
| |
| TALK_TO_SOMEONE:
| |
| type: PLAYER_NPC_INTERACT
| |
| Good job, now the plugin knows what TALK_TO_SOMEONE will be used for. You just wrote that it will be used for the type of object PLAYER and this object is an NPC_INTERACT.
| |
| | |
| Well, so as you can see, say to the plugin that TALK_TO_SOMEONE is an PLAYER_NPC_INTERACT won't be enough, the plugin wants to know other things, and they are called parameters of the object.
| |
| | |
| Let's write them down.
| |
| 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
| |
| Let's explain what we added.
| |
| | |
| We added 3 things : ''item, npc and amount''
| |
| | |
| Let's start with npc :
| |
| | |
| Here <code>npc: 15</code> is a mandatory parameter, you declare to which NPC you want the player to interact with.
| |
| | |
| The <code>item:</code> is an optional parameter, it is here in the case you want the player to interact with an NPC with an item in hand, and that item will be taken from his inventory when the object is completed.
| |
| | |
| What's special here is that <code>item:</code> ''has it's own parameters''. So objects parameters can also have their own parameters, like the <code>location:</code>, we will talk more in-depth of that after...
| |
| | |
| And finally the <code>amount: 1</code> is the amount of time the objects has to be done to be considered as completed (so in our case how many times the player must interact with the NPC).
| |
| | |
| So let's clarify what we have done here :
| |
| | |
| * We created an object called TALK_TO_SOMEONE
| |
| * With type PLAYER_NPC_INTERACT
| |
| * We said that the player will have to interact with the npc with id 15, and he'll have to do it one time
| |
| * And that he will need to have 32 DIAMONDS in his hand that will be taken from his inventoryonce he clicked on the NPC
| |
| | |
| You think there are too much parameters to learn ? Don't worry ! Every parameters and optional settings are listed here : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>
| |
| | |
| === You just created an correctly structured object ===
| |
| <nowiki>*</nowiki>BUT WAIT, we have a problem Youston ! A problem that you will often have if you forget to rigorously write down your quests.
| |
| | |
| ''It's cool we have our object but now what are we supposed to do with it ?''
| |
| | |
| As I said before, objects are like the path of the quest and they have to be linked together to have a clean path.
| |
| | |
| ''So let's say that after our object TALK_TO_SOMEONE we want this someone to start a discussion with you.''
| |
| | |
| Let's write it down with the method seen before :
| |
| TALK_TO_SOMEONE:
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: DIAMOND
| |
| <nowiki> </nowiki> amount: 32
| |
| <nowiki> </nowiki> must_have_in_hand: true
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 15
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> THIS_SOMEONE_TALKS_TO_YOU:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - 'Yeah man I<nowiki>''</nowiki>m talking to ya'
| |
| <nowiki> </nowiki> - 'WAIT 3'
| |
| <nowiki> </nowiki> - 'You just gave me 32 diamonds, now I feel happy'
| |
| <nowiki> </nowiki> - 'It<nowiki>''</nowiki>s the minimum to talk to ya no ?'
| |
| <nowiki> </nowiki> - 'WAIT 5'
| |
| <nowiki> </nowiki> - '&cLove red color m8'
| |
| So I have created a new object called THIS_SOMEONE_TALKS_TO_YOU with the type SERVER_MESSAGE_LIST and then precised the parameters with <code>messages:</code> (and because it's a list i put <code>-</code> before my messages). This object can be found here with all the others : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>
| |
| | |
| <nowiki>*</nowiki>Yay ! Another object, that's fantastic, I understand the idea. But how are we supposed to link them together ? *
| |
| | |
| <nowiki>**</nowiki>We will use the last parameter : <code>goto:</code>
| |
| | |
| Literally like a path, you will tell to the plugin where you have to go when the object is completed, and you will do this with <code>goto:</code>
| |
| | |
| Let's add it :
| |
| TALK_TO_SOMEONE:
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: DIAMOND
| |
| <nowiki> </nowiki> amount: 32
| |
| <nowiki> </nowiki> must_have_in_hand: true
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 15
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
| |
| <nowiki> </nowiki> THIS_SOMEONE_TALKS_TO_YOU:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - 'Yeah man I<nowiki>''</nowiki>m talking to ya'
| |
| <nowiki> </nowiki> - 'WAIT 3'
| |
| <nowiki> </nowiki> - 'You just gave me 32 diamonds, now I feel happy'
| |
| <nowiki> </nowiki> - 'It<nowiki>''</nowiki>s the minimum to talk to ya no ?'
| |
| <nowiki> </nowiki> - 'WAIT 5'
| |
| <nowiki> </nowiki> - '&cLove red color m8'
| |
| <nowiki> </nowiki> goto: QUEST_SUCCESS
| |
| <code>goto:</code> is a special and mandatory parameter, NEVER FORGET to put it in the last line of each of your objects, except for some (rare) special ones (will be explained later).
| |
| | |
| It can admit multiple values like QUEST_SUCCESS or QUEST_FAIL (and other) but here let's focus on what I have written down (other values are, again, detailed here : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>)
| |
| | |
| So with the <code>goto:</code> added, we say to the plugin that when TALK_TO_SOMEONE has been completed he has to go to the OBJECT THIS_SOMEONE_TALKS_TO_YOU And when THIS_SOMEONE_TALKS_TO_YOU is completed (meaning that each lines of the message list has been showed up), the plugin has to go to QUEST_SUCCESS (a way of ending the quest, marking it as succeeded).
| |
| | |
| === Result : ===
| |
| 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.
| |
| | |
| == Precisions and deepening about objects ==
| |
| We are starting to have a lot of tools in hand to create our quest, we will see soon how to use them all together to create a quest. But firstly I want to explain you some little things about objects that you will have to understand to create optimized and clean objects.
| |
| | |
| As I said objects have mandatory and optional parameters.
| |
| | |
| The mandatory parameters are usually always specified when you copy paste an object on : <nowiki>https://github.com/PYRRH4/QuestCreator/wiki/Quest-objects</nowiki>
| |
| | |
| 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).
| |
| | |
| 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:
| |
| <nowiki> </nowiki> type: PLAYER_ITEM_CRAFT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: DIAMOND_PICKAXE
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> name: 'Craft a diamond pickaxe for your friend'
| |
| <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> sound:
| |
| <nowiki> </nowiki> type: VILLAGER_IDLE
| |
| <nowiki> </nowiki> volume: 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_sound:
| |
| <nowiki> </nowiki> type: LEVEL_UP
| |
| <nowiki> </nowiki> volume: 1.0
| |
| <nowiki> </nowiki> pitch: 1.0
| |
| <nowiki> </nowiki> location:
| |
| <nowiki> </nowiki> base: world,100,70,100
| |
| <nowiki> </nowiki> near: 10
| |
| <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
| |
| | |
| 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).
| |
| | |
| Let's show you some examples.
| |
| | |
| Initial object, it works :
| |
| object:
| |
| type: PLAYER_ITEM_DROP
| |
| item:
| |
| type: DIAMOND_PICKAXE
| |
| amount: 1
| |
| With location, it also works :
| |
| object:
| |
| type: PLAYER_ITEM_DROP
| |
| item:
| |
| type: DIAMOND_PICKAXE
| |
| amount: 1
| |
| location:
| |
| base: world,100,70,100
| |
| 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:
| |
| type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
| |
| 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.
| |
| object:
| |
| type: SERVER_WORLDEDIT_SCHEMATIC_PASTE
| |
| schematic_file: 'schematic_file.schematic'
| |
| location:
| |
| base: world,123,13,543
| |
| Here you tell the plugin where to paste the schematic, it's happy now !
| |
| | |
| == Basic mistakes and things to know ==
| |
| | |
| === Mistakes ===
| |
| One object = one object type. You CAN'T put 2 object type in 1 object, you will have to create 2 different objects linked with a goto
| |
| | |
| This will NOT work :
| |
| OBJETC_1:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - '&f[Système de survie] Objectif actualisé : Rendez vous à Oneill en [-1227,180,2715] et donner au [Gérant d<nowiki>''</nowiki>Oneill] le [FRET]'
| |
| <nowiki> </nowiki> name: 'dialogue2'
| |
| <nowiki> </nowiki> progress_name: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> post_message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> post_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: PISTON
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
| |
| <nowiki> </nowiki> must_have_in_hand: false
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 256
| |
| <nowiki> </nowiki> name: 'DONNER_FRET_ONEILL'
| |
| <nowiki> </nowiki> progress_name: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> post_message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> post_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> goto: OBJECT OBJECT_2
| |
| It has to be like that :
| |
| OBJECT_1:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - '&6Well played.'
| |
| <nowiki> </nowiki> - 'WAIT 2'
| |
| <nowiki> </nowiki> - '&f[Survival System] New objective : &aGo to Oneill in &l[-1227,180,2715] &aand give the &l[F.R.E.T] &ato the &l[Oneill Manager]&f.'
| |
| <nowiki> </nowiki> name: '[dialogue]'
| |
| <nowiki> </nowiki> progress_name: '[dialogue]'
| |
| <nowiki> </nowiki> message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> post_message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> post_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> goto: OBJECT OBJECT_2
| |
| <nowiki> </nowiki> OBJECT_2:
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: PISTON
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
| |
| <nowiki> </nowiki> must_have_in_hand: false
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 256
| |
| <nowiki> </nowiki> name: 'Give the FRET to the Oneill Manager'
| |
| <nowiki> </nowiki> progress_name: 'Give FRET to Oneill Manager'
| |
| <nowiki> </nowiki> message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> post_message: <nowiki>''</nowiki>
| |
| <nowiki> </nowiki> post_sound: VILLAGER_IDLE
| |
| <nowiki> </nowiki> goto: OBJECT OBJECT_3
| |
| Always write the text of messages, post_message etc with <code><nowiki>''</nowiki></code>. Ex: <code>message: 'I love tapioca'</code> and not <code>message: I love tapioca</code>. (actually it could work sometimes but it's always better, it's an habit to take)
| |
| | |
| And don't forget to put double <code>'</code> when you want to put one <code>'</code>. Ex: <code>I<nowiki>''ll want you''re tapioca when he''</nowiki>ll want it</code> (basic YAML writing)
| |
| | |
| Don't forget the OBJECT when you want to go to another object. <code>goto: OBJECT A_THING_WITH_A_COOL_NAME</code> and not <code>goto: A_THING_WITH_A_COOL_NAME</code>
| |
| | |
| === Things to know: ===
| |
| In an <code>item</code> parameter you can absolutely add other sub-parameters like this :
| |
| object:
| |
| type: SERVER_ITEM_GIVE
| |
| item:
| |
| type: PISTON
| |
| name: '&7&m-----&f &dF.R.E.T&f &7&m-----&f &8(Quest)'
| |
| amount: 1
| |
| There are 2 type of <code>amount:</code> that you will see during your quest writing. They can be confusing but they are different.
| |
| | |
| For instance :
| |
| 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
| |
| The first <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>
| |
| | |
| Second check if you have any tabulation, YAML absolutely needs only spaces, not tabulations.
| |
| | |
| = Summary =
| |
| Now let's converge everything we just saw !
| |
| | |
| The parameters :
| |
| saving: ENABLED
| |
| name: 'Example Quest'
| |
| description:
| |
| <nowiki> </nowiki> - '&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: <nowiki>''</nowiki>
| |
| send_status_message: true
| |
| send_objective_update_message: true
| |
| restricted_worlds: []
| |
| permission: <nowiki>''</nowiki>
| |
| The branch:
| |
| <code>branches:
| |
| main:
| |
| name: 'main'
| |
| auto_start: true
| |
| starts_at: START_OBJECT
| |
| objects:
| |
| ...</code>
| |
| And the objects:
| |
| TALK_TO_SOMEONE:
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: DIAMOND
| |
| <nowiki> </nowiki> amount: 32
| |
| <nowiki> </nowiki> must_have_in_hand: true
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 15
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
| |
| <nowiki> </nowiki> THIS_SOMEONE_TALKS_TO_YOU:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - 'Yeah man I<nowiki>''</nowiki>m talking to ya'
| |
| <nowiki> </nowiki> - 'WAIT 3'
| |
| <nowiki> </nowiki> - 'You just gave me 32 diamonds, now I feel happy'
| |
| <nowiki> </nowiki> - 'It<nowiki>''</nowiki>s the minimum to talk to ya no ?'
| |
| <nowiki> </nowiki> - 'WAIT 5'
| |
| <nowiki> </nowiki> - '&cLove red color m8'
| |
| <nowiki> </nowiki> goto: QUEST_SUCCESS
| |
| Aaand the FUUSSIIOONN :
| |
| saving: ENABLED
| |
| name: 'Example Quest'
| |
| description:
| |
| <nowiki> </nowiki> - '&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: <nowiki>''</nowiki>
| |
| send_status_message: true
| |
| send_objective_update_message: true
| |
| restricted_worlds: []
| |
| permission: <nowiki>''</nowiki>
| |
| branches:
| |
| <nowiki> </nowiki> main:
| |
| <nowiki> </nowiki> name: 'main'
| |
| <nowiki> </nowiki> auto_start: true
| |
| <nowiki> </nowiki> starts_at: START_OBJECT
| |
| <nowiki> </nowiki> objects:
| |
| <nowiki> </nowiki> TALK_TO_SOMEONE:
| |
| <nowiki> </nowiki> type: PLAYER_NPC_INTERACT
| |
| <nowiki> </nowiki> item:
| |
| <nowiki> </nowiki> type: DIAMOND
| |
| <nowiki> </nowiki> amount: 32
| |
| <nowiki> </nowiki> must_have_in_hand: true
| |
| <nowiki> </nowiki> remove_after_action: true
| |
| <nowiki> </nowiki> npc: 15
| |
| <nowiki> </nowiki> amount: 1
| |
| <nowiki> </nowiki> goto: OBJECT THIS_SOMEONE_TALKS_TO_YOU
| |
| <nowiki> </nowiki> THIS_SOMEONE_TALKS_TO_YOU:
| |
| <nowiki> </nowiki> type: SERVER_MESSAGE_LIST
| |
| <nowiki> </nowiki> messages:
| |
| <nowiki> </nowiki> - 'Yeah man I<nowiki>''</nowiki>m talking to ya'
| |
| <nowiki> </nowiki> - 'WAIT 3'
| |
| <nowiki> </nowiki> - 'You just gave me 32 diamonds, now I feel happy'
| |
| <nowiki> </nowiki> - 'It<nowiki>''</nowiki>s the minimum to talk to ya no ?'
| |
| <nowiki> </nowiki> - 'WAIT 5
| |
| <nowiki> </nowiki> - '&cLove red color m8'
| |
| <nowiki> </nowiki> goto: QUEST_SUCCESS
| |
| Bam, your first working quest, good job ! ''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.''
| |
| | |
| 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 !
| |
| | |
| You can also come and share your creations and your use of quest mechanics, on the same discord ! ^_^
| |
| | |
| Thanks for reading this tutorial ! (NB : and thumbs up again to Lordinouille who wrote it, that's a pretty good job !)
| |
| | |
| Now, that's your turn. The plugin is just awaiting : it's up to you to create quests !
| |