Skip to content

Tags

Tags can be a great solution to add various "checkpoints" if you have small quests or mechanics. With tags and their conditions, you can give your quests the necessary polish so that players do not have to start over or repeat tasks. Tags can do much more, but in this tutorial, we will focus only on how to track quest progress using them.

Requirements

It is helpful to be familiar with the basics of conditions and understand the underlying principles in order to comprehend and apply this tutorial.

1. Creating the folder structure for the example quest🔗

Add a new structure for the example quest in the QuestPackage folder. The name could be "questTracking" for example.

The file structure should look like this:

  • questTracking
    • package.yml
    • events.yml
    • conditions.yml
    • conversations
      • joe.yml
      • bonny.yml
      • fren.yml
Download the files for this tutorial

Instead of manually creating / filling the files, just download them using the command below:

/bq download BetonQuest/Quest-Tutorials d5659f64497f0390a3b084f1b9380e7a135c7139 QuestPackages /Advanced/Tracking-Quest-Progress/1-ExampleQuest /trackingTutorial overwrite
You can now find all files needed for this tutorial in this location: "YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/questTracking"

After you have created all the necessary files, we will begin to fill our conversation files with some small talk. If you already downloaded it with the download command above you can skip this part.

In this tutorial, we will create three NPCs that you have to talk to, and with tags, we will prevent you from talking to the same NPC repeatedly. We will also configure the second and third NPC so that you can only talk to them after you have introduced yourself to the first NPC.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
conversations:
  Bonny:
    quester: "Bonny"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey Stranger! You look new to me. Can you introduce yourself?"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you %player%. Please also introduce yourself to Joe and Fren and come back when 
        you've done it!"
    player_options:
      introduce:
        text: "I am %player%"
        pointer: "niceToMeetYou"
1
2
3
4
5
6
7
conversations:
  Joe:
    quester: "Joe"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player% Bonny already told me about you! Nice to have you here in our town."
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
conversations:
  Fren:
    quester: "Fren"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player%. Already know you because bonny told me about you and that you're new here!"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you tho! I really like new people in our town!"
    player_options:
      introduce:
        text: "That's correct!"
        pointer: "niceToMeetYou"
1
2
3
4
npcs:
  '1': "Joe"
  '2': "Bonny"
  '3': "Fren"

Now that we have our basic conversations we need to add tags to it otherwise you could talk to any NPC at any time and we want to prevent that to get a nice feeling conversation with these NPCs.

2. Adding conditions to the conversations🔗

We are now adding conditions to the conversations to prevent the player having the same conversation over and over again and to make sure that you can only talk to the Fren and Joe after you get the task to meet those.

First we add events to the correct part of the conversation where the tag should be added and in order to that we will add this events with the corresponding conditions to our events/conditions sections.

Highlighting

Every line/word that is highlighted in blue is new to the file!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
conversations:
  Bonny:
    quester: "Bonny"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey Stranger! You look new to me. Can you introduce yourself?"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you %player%. Please also introduce yourself to Joe and Fren and come back when 
        you've done it!"
    player_options:
      introduce:
        text: "I am %player%"
        pointer: "niceToMeetYou"
        events: "addTagIntroducedToBonny"
1
2
3
4
5
6
7
8
conversations:
  Joe:
    quester: "Joe"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player% Bonny already told me about you! Nice to have you here in our town."
        events: "addTagMetJoe"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
conversations:
  Fren:
    quester: "Fren"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player%. Already know you because Bonny told me about you and that you're new here!"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you tho! I really like new people in our town!"
    player_options:
      introduce:
        text: "That's correct!"
        pointer: "niceToMeetYou"
        events: "addTagMetFren"
1
2
3
4
events:
  addTagIntroducedToBonny: "tag add introducedToBonny"
  addTagMetJoe: "tag add metJoe"
  addTagMetFren: "tag add metFren"
1
2
3
4
conditions:
  introducedToBonny: "tag introducedToBonny"
  metJoe: "tag metJoe"
  metFren: "tag metFren"

Now that we have written the events and conditions it's important to actually add the condition tags to the conversations and also add some more conversation so that it makes more sense. This will make the magic work!

Tip

I always start by writing the events into the conversation options. Once the event is written, I proceed to write it in the events section to ensure that the event actually exists. After that, I ask myself: What do I need for the event? Do I still need to write a condition or an objective for it? If you proceed systematically like this, you will make significantly fewer mistakes.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
conversations:
  Bonny:
    quester: "Bonny"
    first: "finishedTask,askingForProgress,firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey Stranger! You look new to me. Can you introduce yourself?"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you %player%. Please also introduce yourself to Joe and Fren and come back when 
        you've done it!"
      askingForProgress:
        text: "Hey %player% I think you don't have met them all yet.. Come back when you are ready!"
        conditions: "!metJoe,!metFren,introducedToBonny" #(1)!
      finishedTask:
        text: "You have met Joe and Fren! We are all there for you if you need something!"
        conditions: "metJoe,metFren" #(2)!
    player_options:
      introduce:
        text: "I am %player%"
        pointer: "niceToMeetYou"
        events: "addTagIntroducedToBonny"
  1. metJoe and metFren are the conditions that you need to negotiate because we want them to be met. We also need introducedToBonny otherwise the conversation starts before the firstGreeting option. Thats because the metXXX tags are true when negotiated.

  2. Both conditions must be true metJoe and metFren in order to activate this conversation. We also add this conversation to first.

1
2
3
4
5
6
7
8
9
conversations:
  Joe:
    quester: "Joe"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player% Bonny already told me about you! Nice to have you here in our town."
        events: "addTagMetJoe"
        conditions: "introducedToBonny" #(1)!
  1. This conditions will be added to prevent the player from talking with the NPC before he not introduced himself to Bonny first.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
conversations:
  Fren:
    quester: "Fren"
    first: "firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player%. Already know you because Bonny told me about you and that you're new here!"
        pointer: "introduce"
        conditions: "introducedToBonny" #(1)!
      niceToMeetYou:
        text: "Nice to meet you tho! I really like new people in our town!"
    player_options:
      introduce:
        text: "That's correct!"
        pointer: "niceToMeetYou"
        events: "addTagMetFren"
  1. This conditions will be added to prevent the player from talking with the NPC before he not introduced himself to Bonny first.

After we have added the conditions and events to the conversations and files we can now test it in-game! You can now only talk to Fren and Joe after you introduced yourself to Bonny.

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.

/bq download BetonQuest/Quest-Tutorials d5659f64497f0390a3b084f1b9380e7a135c7139 QuestPackages /Features/Tracking-Quest-Progress/2-HalfExample /trackingTutorial overwrite

3. Complete the introduction quest (optional)🔗

We will now add some events and condition tags to round up the quest feeling. After we talked to the Fren and Joe, Bonny always would say the same. We can prevent that also adding a condition tag here. Let us have a look:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
conversations:
  Bonny:
    quester: "Bonny"
    first: "startMainQuest,finishedTask,askingForProgress,firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey Stranger! You look new to me. Can you introduce yourself?"
        pointer: "introduce"
      niceToMeetYou:
        text: "Nice to meet you %player%. Please also introduce yourself to Joe and Fren and come back when 
        you've done it!"
      askingForProgress:
        text: "Hey %player% I think you don't have met them all yet.. Come back when you are ready!"
        conditions: "!metJoe,!metFren,introducedToBonny"
      finishedTask:
        text: "You have met Joe and Fren! We are all there for you if you need something!"
        conditions: "metJoe,metFren"
        events: "addTagIntroducedToEveryone"
      startMainQuest:
        text: "Now I could need your help! Would you mind bringing me XXX?"
        conditions: "introducedToEveryone"
        events: #(1)!
        pointer: #(2)!
    player_options:
      introduce:
        text: "I am %player%"
        pointer: "niceToMeetYou"
        events: "addTagIntroducedToBonny"
  1. You can now continue your main quest here with whatever you want. Maybe with a pointer to another conversation or a event to start something.

  2. You can now continue your main quest here with whatever you want. Maybe with a pointer to another conversation or a event to start something.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
conversations:
  Joe:
    quester: "Joe"
    first: "mainConversation,firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player% Bonny already told me about you! Nice to have you here in our town."
        events: "addTagMetJoe"
        conditions: "introducedToBonny"
      mainConversation:
        text: "Very nice to see you again! I dont have any tasks for you at the moment"
        conditions: "metJoe"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
conversations:
  Fren:
    quester: "Fren"
    first: "mainConversation,firstGreeting"
    NPC_options:
      firstGreeting:
        text: "Hey %player%. Already know you because Bonny told me about you and that you're new here!"
        pointer: "introduce"
        conditions: "introducedToBonny"
      niceToMeetYou:
        text: "Nice to meet you tho! I really like new people in our town!"
      mainConversation:
        text: "You again! I dont have anything to do for you! Come back later."
        conditions: "metFren"
    player_options:
      introduce:
        text: "That's correct!"
        pointer: "niceToMeetYou"
        events: "addTagMetFren"
1
2
3
4
5
events:
  addTagIntroducedToBonny: "tag add introducedToBonny"
  addTagMetJoe: "tag add metJoe"
  addTagMetFren: "tag add metFren"
  addTagIntroducedToEveryone: "run ^tag add introducedToEveryone ^tag delete metFren,metJoe" #(1)!
  1. We suggest to remove unnessecary tags and only have the needed ones active.
1
2
3
4
5
conditions:
  introducedToBonny: "tag introducedToBonny"
  metJoe: "tag metJoe"
  metFren: "tag metFren"
  introducedToEveryone: "tag introducedToEveryone"
Download this part of the tutorial

Enter this command in the chat to download this part of the tutorial:

/bq download BetonQuest/Quest-Tutorials d5659f64497f0390a3b084f1b9380e7a135c7139 QuestPackages /Features/Tracking-Quest-Progress/3-FullExample /trackingTutorial overwrite