Difference between revisions of "Your First Quest"

From RPG Creation Kit
Jump to navigation Jump to search
Line 48: Line 48:


An empty Window will open, close it for now and let's rename the file to "[DIALOGUE] UrielsDefaultDialogue". In the Inspector we have to insert an ID for this dialogue that '''must be unique''' and not shared with any other ID. I'll insert "''DIALOGUE_UrielsDefaultDialogue''".
An empty Window will open, close it for now and let's rename the file to "[DIALOGUE] UrielsDefaultDialogue". In the Inspector we have to insert an ID for this dialogue that '''must be unique''' and not shared with any other ID. I'll insert "''DIALOGUE_UrielsDefaultDialogue''".
Now you need to do the most important thing, which is [[Databases|Updating the Databases]]. Check for the tool-bar on the upper-left part of the screen, click on "RPG Creation Kit -> Update All Databases". A short loading will happen, and your new dialogue will be included in the Dialogue Database, also check the console for any error. If there's any, you may have inserted an already used ID, so change the ID and try again.


Now you can double-click on the file or click "'''Edit Graph'''" from the Inspector to reopen the Dialogue Window and start making the dialogue.
Now you can double-click on the file or click "'''Edit Graph'''" from the Inspector to reopen the Dialogue Window and start making the dialogue.
Line 86: Line 88:


Perfect, what we need to do now is to tie those things the Player says to responses of the NPC and change of state.
Perfect, what we need to do now is to tie those things the Player says to responses of the NPC and change of state.
In both cases, we want Uriel to reply, so I'll add two more NPC Dialogue Lines and connect each one with a Player Question.
I want to test if everything is good so far, so I'm going to set the After Line for both to "'''End Dialogue'''", so that we can have a correct graph (a correct graph is a Graph that doesn't have empty ports or references and generates no error while being executed) without adding more content to it.
The first NPC Dialogue Line will make the NPC say "''Great! Thank you.''" while the second one will make him say "''Goodbye.''".
If you did everything correctly so far, you should have this situation:
[[File:Dy 3.png|508x508px]]
Hit CTRL+S and close the Dialogue Window.
What we need to do now is to assign this Dialogue to be the Default one that Uriel will use, so let's open the [[Rck AI Editor]] and let's search for "Uriel001".
Let's go straight to the '''Behaviour''' tab and let's change his '''Current Dialogue''' to the one we just created:
[[File:Dy 4.png|473x473px]]
'''Click SAVE''' and close the Window.
At this point Uriel has the Dialogue we've just created. So we can

Revision as of 15:37, 3 March 2022

In this tutorial we will use NPC we've created in the NPCs Creation and the Cell we've created in the Creating your First Cell tutorial to create a fairly simple quest step by step.

Designing the quest

The first thing that we are going to do before actually doing anything is to design the quest. It is a good idea to think about the quest you want to make, the stages and how it should proceed before you actually start implement anything.

In this tutorial our quest is titled "To Break The Quiet", and it will go this way:

We'll encounter Uriel, the NPC we've created in the previous tutorial sitting peacefully outside his shack. If the Player goes and talk to him he will ask for our help. He will say that there are some bandits that are bothering him and stealing in his house, and that shortly they will come back. If the Player accepts the quest, as soon as the dialogue ends two bandits will arrive from behind his shack and demand golds. Uriel will not bow to their request and start a fight.

The quest can then end with Uriel dead or alive, depending on how the fight goes. If he'll stil be alive before the bandits die, he will give us some of his gold, otherwise the quest will end with a failed objective.

Creating the skeleton of the Quest

Let's go ahead and start developing our quest. The first thing you have to do is to organize your project, create a folder and name it "To Break The Quiet", we'll insert everything related to this quest inside this folder.

Go ahead and create a New Quest by right clicking in the project window -> Create -> RPG Creation Kit -> Quests -> New Quest and name it "- [QUEST] To Break The Quiet", then open it in the Quest Window by clicking "Configure Quest" in the Inspector.


Set the name, ID and description of the quest, I'll have:

Quest Name: To Break The Quiet

Quest ID: SQ_ToBreakTheQuiet

Quest Description: I met a man named Uriel that asked for my help, it seems that there are some bandits that are bothering him... I should give him my help.


We don't need to move anything else for now, switch to the "Quest Stages" tab and right click in the list on the left, then click "New" to create a new Quest Stage. Insert the ID of this stage to be 10 and now we have to configure the Quest Stage on the right.

The description will be: Learn more about the Bandits that are bothering Uriel, and I will also check Display Log Entry, because I want this Description to show up on the screen.


Then go ahead and create a new Quest Stage, it will have as ID 20 and the description will state: Protect Uriel from the Bandits. I'll still have checked the Display Log Entry because it is an objective I want the Player to see.

For reference, all the settings of the Quest inside the Quest Window.

Create another stage, Stage 30 and set its description to be: Speak to Uriel to collect your reward, again, this will have Display Log Entry set on true. This one will have the checkbox Complete Quest set to true, since when this stage will be completed, the quest will end.


Now if we analyze those three stages, when played sequentially they describe exactly our quest. The only thing that misses is the other ending we've explained, the one where Uriel dies. To achieve this, we are going to create a new Quest Stage, Stage 40 that will have as description "# This stage is completed if Uriel dies", it will have Complete Quest set to true, and Display Log Entry set to false.

This is because if Uriel dies, this quest stage 40 will be triggered immediatly, the Description will be hidden from the Player and the quest will end.


Implementation - Stage 10

The first thing that we are going to build for this quest, is Uriel's Default Dialogue, more specifically, this is the dialogue that Uriel will have as soon as he gets instantiated, and the first that will run if the Player speaks to him.

Create a new folder inside the previous one named "To Break The Quiet" and create a new Dialogue by right clicking in the project window -> Create -> RPG Creation Kit -> Dialogues -> New Dialogue Graph.

An empty Window will open, close it for now and let's rename the file to "[DIALOGUE] UrielsDefaultDialogue". In the Inspector we have to insert an ID for this dialogue that must be unique and not shared with any other ID. I'll insert "DIALOGUE_UrielsDefaultDialogue".

Now you need to do the most important thing, which is Updating the Databases. Check for the tool-bar on the upper-left part of the screen, click on "RPG Creation Kit -> Update All Databases". A short loading will happen, and your new dialogue will be included in the Dialogue Database, also check the console for any error. If there's any, you may have inserted an already used ID, so change the ID and try again.

Now you can double-click on the file or click "Edit Graph" from the Inspector to reopen the Dialogue Window and start making the dialogue.

We've seen how Dialogues work in the previous tutorials, every Dialogue must start with an Entry Node, so let's add it.

Right click anywhere in the Window -> Dialogue System -> Entry, and a new Entry node will appear. We don't need further action for it, so let's go ahead and keep creating our Dialogue.

Connecting two Dialogue Nodes.

I want Uriel to greet the Player as soon as the Dialogue start, and then ask for help. We can have the NPC saying a line with the "NPC Dialogue Line" node, so let's add it. Right click anywhere in the Window -> Dialogue System -> NPC Dialogue Line.

That will add the node inside the Graph, now to make this NPC Dialogue Line the first thing that happens when the Dialogue starts, we need to connect the First Node of the Entry to the Input of the NPC Dialogue Node. You can do this by clicking and holding on the blue "First Node" dot and dragging the line to the blue dot "Input".

Now what we need to do is to fill the information inside the "NPC Dialogue Line" node.

The only thing that is currently displayed is the "Line", which represents the text that will be displayed to the Player while the NPC speaks this line.

So let's fill it, I'll write inside:

"Hail stranger, it's good to see a friendly face around here... after all the bad ones that comes more than often..."

Now you can click on "Show/Hide" to unveil hidden settings.

You can ignore most of the things for now, the "Plain Line" will be set to false since we want this dialogue to stop the Player and use the full interface, it will trigger no Events. You may just want to set the "Line Time", which is the time in seconds that will pass before this line is considered spoken.

Click again on "Show/Hide" to make the Node occupy less space,

The first NPC Dialogue Line settings.

What should happen next is that the Player will have to say something, for doing that we can use the After Line of the NPC Dialogue Line node, click on it and select "Player Questions".

More settings will appear, we can ignore everything for now and jump to the "Player Questions" list, click on the + button two times to add two things the Player will be able to say.

You'll notice that Elements will appear in the list with a violet dot right to them.

Let's open Element 0 by clicking on it.

Here you can configure what you want to say and how questions should appear in the UI. For Element 0 I'll have as question "Is there something wrong?" and it will have the Position 0, that means it will always be on the top of the Dialogue Interface.

For Element 1, the Question will be "I need to go" and the position will be 1.

The checkbox "Delete After Answer" is used for deleting the question from the current dialogue interaction after it has been selected, it is not needed for now.

Perfect, what we need to do now is to tie those things the Player says to responses of the NPC and change of state.

In both cases, we want Uriel to reply, so I'll add two more NPC Dialogue Lines and connect each one with a Player Question.

I want to test if everything is good so far, so I'm going to set the After Line for both to "End Dialogue", so that we can have a correct graph (a correct graph is a Graph that doesn't have empty ports or references and generates no error while being executed) without adding more content to it.

The first NPC Dialogue Line will make the NPC say "Great! Thank you." while the second one will make him say "Goodbye.".

If you did everything correctly so far, you should have this situation:


Dy 3.png

Hit CTRL+S and close the Dialogue Window.

What we need to do now is to assign this Dialogue to be the Default one that Uriel will use, so let's open the Rck AI Editor and let's search for "Uriel001".

Let's go straight to the Behaviour tab and let's change his Current Dialogue to the one we just created:


Dy 4.png


Click SAVE and close the Window.

At this point Uriel has the Dialogue we've just created. So we can