The RPG Series
RPGs are one of gaming’s most popular and longest lived genres, and some of the most popular series in the world have had entries (or even got their start) on the GameBoy. And now, thanks to GB Studio, it’s your turn to create an RPG of your own!
In this series, we will cover how to use GB Studio’s built-in events to create a basic RPG system that you can expand for your own game. All project files will be available to download at the end of the article, and inside you’ll have all the examples and assets we use in each article (along with some additional comments). You can use these as a reference or even expand on them to create your own game.
Back to Town Part 3 – Quest Tracking
Hmm…what were we doing again? Oh, that’s right! We were working on an RPG tutorial. Perhaps we wouldn’t have forgotten what we were working on if we had some kind of way to keep track of our progression…
I know! Let’s add a quest tracker.
A Simple Task
If you’ve played around with the sample game at all, you’ve likely seen basic quest tracking: a scene showing tasks you can complete in the game, with an actor or background art that changes to confirm when a task is complete.

Since this was made back in the good old days of GB Studio 1.0, our quest list displayed all its options immediately, and our checkboxes were actors that switched between animation frames to show either an empty checkbox or a checkmark. But we’ve come a long way since 1.0, and we have a lot more tools at our disposal to spruce up this scene.
For this tutorial, we’ll focus on a single quest. All great heroes on an epic quest to kill a god have humble origins, so we’ll start with the basics: finding a missing cat.
Creating Our Journal Scene
Create a new scene named “Journal” using the provided journal.png background. We’ve removed the other quests for now, but you’ll also notice that we’ve adjusted the text for the “Missing Cat” quest.

Since we’re going to be tile-swapping, we need to make sure each of the letter tiles is different from other instances in the same scene. For example, we don’t want the two “S” tiles in “Quest List” to be changed. Put a green background on these tiles to distinguish them from other similar tiles.
Using this approach, we can add more lines of text for other quests as we expand our game.
Updating the Tiles
If you’ve been following along with the series from the start, you’re already an expert in tile swapping. But for those of you just joining us, here are the steps to make our menu track the quest properly.
First, in our Journal scene, let’s hide the text for the quests we don’t have.

Before our scene fades in, let’s add an event to track if we have already talked to the quest giver and received the quest in the first place. To do this, we’ll be using Variables and Flags.
- Create a new Global Variable named “$Quest: Missing Cat”.
- Use the [If Variable has Flag] event to check whether the player has encountered this quest.
- If the variable does not have Flag 1, meaning the player does not have the quest, we’ll replace the quest title in our Journal with “?” characters.
- Use the [Replace Tile at Position] event and the provided letters.png tileset to replace each letter with tile 27 (our question mark tile).
- Use the check.png tileset to change the checkbox to an empty checkbox.


You’ll notice that we skipped tiles 7 and 8. Since we already replaced the instances of I and S earlier in the script, we don’t need to repeat that event for those tiles.
Next, we need to add a way to access and exit our Journal scene. For now, we’ll assign that action to the start button, just like in the Sample game. We’ll also want a way for the game to remember the previous scene when we open up our journal. That way, we can easily return to where we were when we close the journal. To do that, we can use the Stack.
Editor’s Note: Our basics series has an overview of the Stack in our previous tutorial on Menus.

- In the On Init tab of our Town scene, create a new [Attach Script to Button] event bound to Start.
- Within this event, use the [Store Current Scene on Stack] to save our position in the current scene.
- Add a [Change Scene] event that points to our journal.
To leave the Journal scene, we’ll follow the same formula.
- In the On Init tab of our Journal scene, create an [Attach Script to Button] event bound to Start.
- Within this event, use the [Restore Previous Scene from Stack], returning us to our Town (or wherever we accessed the menu) scene.

Finally, let’s make the player sprite disappear in the Journal scene so it feels more like a proper menu. Go to the On Init tab of the Journal scene and add a [Hide Actor] event somewhere before the [Fade Screen In] event. Use the dropdown to select the actor you want to hide — the player.
Now, when we load our scene, our Journal should look like this:

Looking good! You can also add the script to access the journal in other town scenes, like the Inn or Shop.
Fulfilling our Destiny
With our Journal completed for now, let’s work on the actual quest. If we’re going to find a missing cat, we’ll need to put her somewhere in the world. She’ll also need an owner to return to. First, let’s add an actor for the owner somewhere in our town.

To begin, we need to see if we’ve started this quest. Just like in our journal, we’ll use the [If Variable has Flag 1] event. Since we haven’t started the quest, our variable shouldn’t have any flags, so we’ll move to our “Else” section next.
In the Else section, we’ll need to ADD Flag 1 to our quest variable. Let’s add some dialogue stating that the cat is missing, and give the player the choice to accept or decline the quest using a [Multiple Choice] event. After they’ve accepted, we use the [Add Flag 1 to Variable] event to confirm the selection.
Reminder: Use ADD for flags instead of SET because setting a Flag will overwrite the variable’s current flags with those set at that event. While this doesn’t affect our current simple quest, more complex quests may have multiple flags in the future.
With the quest accepted, we need to update our Journal scene to reflect that. Back in the Journal On Init script, in our “If Quest:Missing Cat has Flag 1” event, we can add another series of [Replace Tile at Position] events to replace the tiles with the correct letters.

Let’s see it in action:

Lookin’ good!
The Finishing Touch
All that’s left to do is complete the quest! Back in our town, let’s hide a cat actor somewhere.

We’ll need to use its script to update our Quest variable to get the next flag for the quest. Let’s give the cat some basic dialogue, and then check which step of our quest we’re on using the [if Variable has Flag] event.
If we have Flag 1, that means we’ve talked to the owner and know our friend here is the missing cat. After a little dialogue and a movement action, we can add Flag 2 to our Quest:Missing Cat variable and deactivate the cat.
If we haven’t talked to the owner yet and don’t have Flag 1, we can give the player a hint in the “Else” section of our script.

We’ll also want to make sure the cat doesn’t reappear if we change scenes (like entering any buildings or using our newly created journal). In the Cat’s On Init script, we’ll check if we’ve found the cat yet (Flag 2), and deactivate the actor if we have.

With our cat claimed, let’s return to the owner. We’ll ignore the logistics of how you carried a stranger’s cat this far and survived — it’s a fantasy game after all (and a very friendly cat, just look at that face!).
Finishing up the owner’s script gets slightly more complicated. First, we’ll need to check if the quest has been completed before we can determine what dialogue to show. In our first If statement (If Variable Has Flag 1), add a check to see if the variable has Flag 3.
If the quest does have Flag 3, it’s been completed. We’ll show some basic dialogue. In the Else clause, add another check to see if the variable has Flag 2. If it does, we’ve found the cat, but we haven’t turned it in yet.
We’ll add some dialogue and give the player a basic reward (in this case, 20 gold). The most important thing will be updating our Quest variable’s status to Add Flag 3.
Finally, if we have Flag 1 but don’t have Flag 2 yet, we’ve accepted the quest but haven’t completed it. We can add different dialogue here in the final “Else” section.

The last thing we need to do is head back to our journal and mark this quest as completed. In the same script where we show the quest’s name, add a check for Flag 3 and change our checkbox tile based on that status. If we have Flag 3, let’s update the box tile to show a Check Mark tile. But if we don’t have that flag, we’ll display the normal checkbox.

Quest Complete!
With our missing cat found, we’ve not only completed the quest in the game but also the third quest of our series. Next up, we’ll return to our Battle scene and use some of the items we purchased earlier in town.

Bonus Objective:
To flesh out the game’s world a little more, I created another cat actor that hides or shows itself if the cat has been found. Using your new mastery of flags, you should be able to duplicate that yourself! Try to implement that yourself using the project files. You can even try to add new steps to the quest using additional flags.
You can download the project files below:
This article is part of a series: Let's Build an RPG!

Friendly Neighborhood Game Designer, Podcaster, and (ex)Librarian (he/him)
GB Studio Games | Tabletop Games





