Hello! I got a PM asking about expanding a tutorial I wrote a few years ago about a questing system. I haven't used RPGMaker in a long looong time, but here goes.
Simple Quest System - A Beginner's Guide
What this tutorial will cover:
- Having an NPC react differently depending on what part of a quest you are on
- Keeping record of multiple enemies killed.
For this tutorial, we are going to use the following example. You can of course, follow along with your own example if you want.The innkeeper at the town you are visiting is having a pest problem.
Her attic is filled with bats and she can't get them out herself because she is allergic.
If you help her clear 5 bats from the attic, she will give you 100 gold and
let you stay at her inn for free in the future.If you'd like an example to follow along with, or to try out, you can download the finished tutorial > here <
Edit: Here is a link to my 2007 tutorial that is similar.
Now, the first thing we need to do is set up the quest. Make an NPC and have her ask you to get rid of the bats for her.
Now that we have the option to start the quest set up, you'll want to keep track of how far the player is in that quest. Since you just accepted it, you'll want to add another event after the quest is taken (Below the "Thank you so much" message in this example). Pick Control Variables
and then set the variable for this quest to "1" since we just accepted it.
Now, your event should look something like this:
Now that you have accepted the quest, there is no need to have the innkeeper give it to you again, so you'll want to do two things.
- Make another variable to count how many bats have been killed
- Make another event page for the innkeeper for telling you that you haven't finished the quest yet
Click "New Event Page" and look at the section on the left that says "Conditions". This is what is required for this page to appear. Since we want it to appear after you've accepted the quest, change it so that the requirement is that your quest variable is at 1 or above
. Make sure you set the NPC's graphic as well.
Now, when you talk to her, she is going to see if you've killed five bats or not. For this, you'll use a Conditional Branch
You want it to check the Variable BatsKilled to make sure it is greater than or equal to
5. The reason you want it to be greater than or equal to is because if you kill six bats, she will not finish the quest for you.
You also want the box at the bottom to be checked so that if you haven't killed the five bats yet, she will act differently.
Now, fill in her behavior for each scenario. Make sure in the >=5 branch, you set the quest variable to 2.
Once the quest is over, you will want to make a last page for how the NPC will behave after you have finished the quest. Make the Conditions
that the variable for your quest is 2.The following portion applies to enemies you encounter randomly for your quest, or enemies that you specifically place for your quest.
Now that we have the NPC's behavior set up, we need to give the variable for the amount of enemies defeated to go up. Go into the Troops tab in your database and make the troops for enemies that you'll be fighting on your quest.
Once you've set up the encounters, Look at the Conditions
Change the Span
to "Turn" (This is important)
, and the Condition
to "Enemy: (Whichever enemy is the quest target)'s HP" and set the condition to "0% or below".
Then in the events bar, add a Control Variable
event that will Add 1 to the counter variable you set up earlier.
Then repeat this step for each target enemy in each encounter.
Now, just set up the encounters (you can either have enemies that you can see on the map, or use random encounters) and your quest is finished!
If the quest targets can be encountered while you are not on the quest, you may want to add a Conditional Branch to the events in the Troop that only adds 1 to the variable if you are on the correct stage of the quest.