Over the past few weeks, I’ve talked about Modern Algebra’s message manager, and just a bare handful of all of the neat handful of things it can do.
Quite a while back I discussed how I’m using a program called Chat Mapper to handle the 100s of branching dialogues in Vidar.
This week and next, it’s time to put it all together. For the next several posts, I’m going to be discussing how to integrate with Chat Mapper, customize it to your liking, integrate with Yanfly’s or Modern Algebra’s message systems, etc.
To really get this going, you need several items, none of them optional:
- The Chat Mapper application, along with at a minimum the indie license, so that you can export the project to JSON
- Ruby installed on your computer – not just RPG Maker, but Ruby itself, which you can download here.
- A script to integrate into Chat Mapper, which I’ll post later this week
- A little program to convert the JSON file to .rvdata, also to be posted later this week
And then some optional add-ons. You’ll only need at most 1, and if you don’t want to use any, that’s fine too. These help with things like showing names, controlling the window position, all that fun stuff.
- Modern Algebra’s ATS: Message Options script for VX Ace
- Yanfly’s Message System
- Neo’s Message System
If that sounds like a lot, it is; this system is not for NPCs who have, at most, 5 things to say to you in a very linear pattern. For that, RPG Maker’s conditional branches and numerous event pages will more than take care of you. Use this if:
- You have dialogue based on extremely complex conditional statements (e.g., “say X if $game_variables is between 3 and 8, AND if either switch 10 is on OR switch 11 is off”); or
- Your NPC has 30+ things they can say in a game.
Since both apply to Vidar, developing a technique to handle this was pretty necessary. Why is this technique now beneficial? It allows for easy manipulation. Suppose you made an error in one of your conditional branches – it’s extremely easy to track down. Suppose you want to move a text option to a different branch. Just cut/paste. Suppose there are several different ways to end up at the same dialogue; you only have to change it once if you want to edit instead of 12 times. To do these things in RPG Maker with dozens of nested conditional branches, labels, jumps, etc. is just not feasible.
Today, we’re going to get into the nitty-gritty of how to set up our Chat Mapper file.
When you start a new project, you’ll be confronted by a ton of windows in the interface. Don’t worry, a lot of this is straight forward, and my script uses very little of it. In fact, Chat Mapper is a powerful tool that has review tools, it’s own scripting interface, and more. We’re going to ignore most of all of that.
One of the windows will have two tabs labeled “Assets” and “Conversations.” Assets can include a whole bunch of things, but the only one that is considered in the script is “Actors.” These are the people talking. You can add stuff to items/locations/variables, but short of modifying my script, it won’t matter 😉
Let’s be clear, the “Actor” here isn’t limited to party members like it is in RPG Maker. Instead, “Actor” means anyone who talks – NPCs specifically included. Click the gear in the Actors window and add a new Actor. Name your Actor – you can use the description field to help you remember who they are just in case. Make as many as you need to – you’ll probably need a lot! If your player or players can speak, don’t forget to create Actors for them as well.
The conversation is the meat of Chat Mapper. As with “Actor,” it’s also a misnomer – don’t think of a Conversation as a single interaction with an NPC. Instead, each conversation includes all possible interactions with a single NPC. So, for example, if you have an NPC who is a shopkeeper, a quest-giver, and a flavor-text-adder all in one, ALL of their stuff will go in a single conversation.
Create a conversation. While you can name it whatever you like, I encourage you to name it the same as the NPC to keep things simple. When creating a new conversation, you’ll see two fields – Actor and Conversant. Each has a drop down menu next to it which is populated with all of the Actors we just made in step 1. So if each is an Actor, but one is called Actor and one is called Conversant, wtf is going on?
In any kind of logic tree – including our dialogue tree – we’ll call the end parts “leaves.” These leaves can be quite long. Sometimes your conversation goes back and forth between various people. Chat Mapper will auto-alternate between Actor and Conversant set at this stage, so that you can have a back and forth. Don’t worry, none of this is permanent and will be explained more below. For now, just note that if your player character can and regularly does engage in conversation, make them the Conversant. If they don’t, then put the NPC in both slots. Again, this can always be changed in one-off situations.
There are two kinds of “nodes” – Groups and Dialog. Dialog are the leaves we talked about above – they’re the end of the the tree, once we’ve finished all of our logic. They include the things that our speakers should say and, as we’ll see later this week, script calls. If we were to match them up to something in RPG Maker, they’re the text box, the command “show text.”
The other kind, Groups, are the branches of our tree. Unsurprisingly, they match up to our conditional branches in RPG Maker. They evaluate whether something is true or false, and spin the conversation off in different directions.
There are a ton of ways to add these nodes – right clicking on a current node, hitting the + button, just hitting enter or shift-enter – and you can use whatever shortcuts you like. For these kinds of questions, the Chat Mapper documentation is your best bet.
When you click on a node, the “Properties” window will open. For Group Nodes, the two things that matter are Title and Description. Title is what you’ll see as your label, and it’s going to help you navigate your tree. I’ve co-opted the Description field to do all of the work. Here, you want to add a statement that evaluates to either true or false – i.e., a boolean.
What does that mean? Things like “Switch 25 is on” or “Variable 8 is above 100” or “The Player has the Lantern in their inventory.” All of these things can be either true or false. If true, we’ll go one way, if false, we’ll go another. But we need to represent them as scripts in our description field, so we’d write:
- $game_variables > 100
- $game_party.has_item?($data_items) #here, we use the ID of the item in your database
We can also combine our booleans using && (for and) and || (for or) to make this more robust.
We’re always going to add two more nodes beneath a group. These can be dialog, more groups, or a combination thereof. The left node will be if the statement evaluates to False. The right node will be if the statement evaluates to True. Mess up the order? No worries, just right click on a node and you’ll see an option to move the position
Our dialog nodes, our leaves, are the termination of a branch (although that’s not always strictly necessary, as we’ll examine later this week). Once we’ve evaluated all of these booleans, we’re ready to actually have our dialogue appear. Here, the Properties menu looks a little different when we click on it.
Title is just for your own information again. Description should be left blank. Actor will be read later if we want to do things like pictures, name boxes, etc. Conversant is meaningless – it’ll be populated with whatever you selected when you created the New Conversation. Dialogue text is where the magic happens. Enter your text exactly as you would in RPG Maker, with in-line codes and all. For example, the “\|” here will make the text pause a whole second.
Generally, you’ll want to keep each dialog node to four lines (which is the default height of a text box in RPG Maker). Want to say something else? Just add another dialog node beneath.
There’s a lot more left to do, but that’s it for today. Get started on making your massive dialogue trees!