Skip to main content

Affection mechanics in RPG Maker: Dialogue.

We're getting into the weeds now. This is not for the faint of heart! And for aspiring game makers, I can't guarantee this is the easiest way to go about this, but it's what I've cobbled together during my time in RPG Maker MZ.

First of all, I establish some variables. These are numeral integers that you can set, add to, subtract from, multiply, whatever - and then apply to any other variables or game parameters you like, like gaining or losing a very specific number of HP. I name one variable per teammate.

 

The idea: whenever you encounter a teammate for the first time, you can talk to them to raise their Affection variable a little bit. Let's say I want to plop the skater Wreck on a map. I create a new event - one square on the map. This will be Wreck. She will be hanging out, doing squats.

 

I open the event's details. On the left side of this window, I specify her image, that she'll be "stepping" (animated), that she doesn't change direction when you click on her, that the player cannot walk through her, and that the contents occur when you click on the event with the Action button.

This is page 1 of 11. Note that in the upper left region, the conditions are all unchecked. When you click on any event, it searches starting at the highest-numbered page to see what conditions are met and keeps looking, in order, all the way down to 1. The way this is set up, page 1 is what occurs if none of the other page's conditions are met. (Nine of the other pages are set to occur if a gift switch is set.) In the directions for this event - the large white box - I specify that her animation changes, she says "Glad you could make it!" with her name and portrait specified, and, unbeknownst to the player, 2 Affection points are earned. The self switch command then tells the game to flip an on/off switch specific to this event (teammate) only.

Here is page 2.

Now, when you talk to Wreck again, this happens instead. Note that "self switch A" is checked. The event's contents check what your Affection level is and have the character respond with the appropriate dialogue. (I could make a separate event page for each of these instead of nesting if-else statements, but I find this easier to keep track of.) If I hadn't turned on self switch A, the event would go to page 1 over and over, and you could rack up points infinitely. Self switches are a tool that I explored a little later in my learning curve, so if you go back to the first few maps of Rorasuketo, there are game-wide Switches and if-else statements that I used instead. It turns out that is incredibly cumbersome. Self switches function to create a nice, easy "That's done - now never do it again."

In case you didn't know, every instance of \.\. in a text box triggers a half-second pause in the scrolling text. I probably flick those keys in my sleep with all the freaking dialogue I type.

And that's the basics of how the game tracks Affection. Maybe another time, I'll talk about how the gift system works.

My theory: McDermott never liked Daboll's high flying offense, but had ... 


Comments