In this tutorial, you will learn the basics of the conversations. These allow you to create a dialog between the player
and a NPC. Therefore, these are the basic tool for story telling.
Usually, conversations happen between a NPC and the player.
Therefore, we need to create the npcs section in the package.yml so that the plugin knows which Citizens NPC
uses which conversation. This is how it works:
package.yml
12
npcs:'1':"Jack"
This links the NPC with the given Citizens ID (1) to the conversation with the given identifier (Jack).
Save the file after editing.
How to create a Citizens NPC? Where do I find the NPC's ID?
Execute this command if you haven't created an NPC yet: /npc create Jack
This will show you the ID of the newly created NPC.
If you already have one, do this:
Stay close to the NPC who's ID you want.
Type the command /npc select to select the nearest NPC.
Type the command /npc id to get the ID from the selected NPC.
A BetonQuest conversation is a cycle of responses between the NPC and the player.
Anything the NPC says is called NPC_options, everything the player answers is called player_options.
A conversation always starts with an NPC_option.
Now the player must answer the NPC using a player_option.
Options point to each other using the pointer argument. In the case of an NPC_option, the pointer argument would contain
the name of a player_option.
Usually, a player has more than one answer to choose from. This is done by adding multiple player_option names to a
NPC_option.
After the player responded, they are shown another NPC_option that the previously chosen player_option points to.
Whenever either a player_option or a NPC_option point to no other option the conversation ends as there are no more
responses or answers.
You can easily check if your quest is working on the server.
Open the file "jack.yml" in the "conversations" folder.
Copy the above conversation into it and save the file.
Now type /bq reload in the chat and right-click the NPC.
You can select the answer by pressing the jump key (Space by default).
Let's see how to create multiple responses for the player to choose from using the pointer argument.
A NPC_option can point to multiple player options at the same time.
As soon as a pointer argument contains more than one player_option, the player can choose.
Tip: Highlighted lines in blue are new compared with the previous example.
With these changes, the mayor asks the player where he is from.
The player can either say that they are from a smallIsland or from a
bigCity. This creates two different paths through the conversation.
Let's join these paths again to show the same ending:
Add the same pointer argument to both paths' NPC_options. They point to the new yesPleaseplayer_option.
The following graph shows the paths through the conversation. Since there are two pointers assigned to the whoAmI option,
the player can choose between one of the paths.
Conversation Flow Graph
Try the conversation ingame by saving the file and executing the /bq reload command!
Then right-click Jack.
Select different options by using the keys for walking forwards and backwards (W and S by default). Confirm
options by jumping (Space by default).
Is the example not working?
Get the correct configs by running the following command.
This will overwrite any changes (including NPC ID's and locations) you have made to the example.
Linking NPCs to conversations is explained in the basics tutorial.
You've learned how to create simple conversations in which the player can choose different paths.
In the next part of the basics tutorial you will learn how Jack the mayor can give food to the player using events!