How to make different NPC dialogue (that loops and DOESN'T loop)

Hey there!

So, I'm a complete beginner to RPG building and I've tried researching this on the forum and on Google as a whole, but still can't figure it out, thus here I am humbly asking for help. You'll be seeing a lot more silly questions from me in the future and I apologize in advance.

What I'm trying to do is get a character to say different lines each time the player interacts with them (around three dialogue options, probably). I'd like to have some characters start looping after all the options are read, while others would repeat their last interaction over and over. I assume the event contents for both of these will differ a bit, which one is harder to program I don't know.

I'll try to follow along with all the "conditional branches" and "switches" and "variables" to the best of my ability, but once again, please assume I'm a toddler and explain as such.

Thank you very much for your help 🙂)
If a character should rotate through a bunch of different interactions, you can make it depend on a variable's value and make it count-up every time.

Spoiler: Rotating through 3 interactions and then always stuck on last one
Code:
<>If Variable [0001] == 0
 <>Show Text: "This is reaction A. Appears on first interaction."
 <>
: ELSE
 <>If Variable [0001] == 1
  <>Show Text: "This is reaction B. Appears on second interaction."
  <>
 : ELSE
  <>Show Text: "This is reaction C. I will say this line always now."
  <>
 : END
 <>
: END
<>Change Variable [0001] += 1
<>

There is a simple way to make the counter loop back when it overflows by dividing with the amount of possible interactions, but using the remainder instead of its quotient (see last line).

Spoiler: Rotating through 3 interactions and then go back to the first
Code:
<>If Variable [0001] == 0
 <>Show Text: "This is reaction A."
 <>
: ELSE
 <>If Variable [0001] == 1
  <>Show Text: "This is reaction B."
  <>
 : ELSE
  <>Show Text: "This is reaction C."
   :          : "Next time, we'll go back to A."
  <>
 : END
 <>
: END
<>Change Variable [0001] += 1
<>Change Variable [0001] %= 3
<>

In case somewhere you want a random interaction to happen, just put the variable-command at start instead of end and make it set the value to "Random" between min and max.

Spoiler: Choose one of 3 interactions randomly
Code:
<>Change Variable [0001] = Random (0..2)
<>If Variable [0001] == 0
 <>Show Text: "This is reaction A."
 :          : "I don't know yet what to say next time."
 <>
: ELSE
 <>If Variable [0001] == 1
  <>Show Text: "This is reaction B."
 :           : "I don't know yet what to say next time."
  <>
 : ELSE
  <>Show Text: "This is reaction C."
 :           : "I don't know yet what to say next time."
  <>
 : END
 <>
: END
<>

With a bit of playing around with numbers, there is even more possible (like some interactions occuring multiple times or having higher/lower chances to be picked).

Also, if different cases for the same NPC get too complex, you may want to put them on multiple event-pages (and sometimes, using switches may be the better choice instead of a counter).

Pages are checked based on their conditions-box on the left. If all conditions are met, the page will be active, priority starting from the highest ID down. So if page 7 matches all conditions (or doesn't have any), it will activate without looking into page 6 and below.

~炬燵あ
This is perfect, thank you so much!

One thing though, I've never seen "if variable" in RPGM2k, and "ELSE" doesn't come up in anything other than cond. branch... where in the event commands do I look to find those?
One thing though, I've never seen "if variable" in RPGM2k, and "ELSE" doesn't come up in anything other than cond. branch... where in the event commands do I look to find those?
"If variable" is the conditional branch. Akira was typing out what you'll see on the screen once you've entered the event commands, not the names of commands for you to click on.

The other way that is a bit less efficient but might be easier for you to follow is to just use different event pages.

Page 1:
say a thing
turn on self switch A

Page 2, condition of self switch A:
say a thing
turn off self switch A
turn on self switch B

Page 3, condition of self switch B:
say a thing
turn off self switch B (will make you loop back to page 1)
Sorry but... STOP IT, for real. It's nice that you want to help, parts of what you say are still true.
Yes, I should've explained what "If" and "Else" come from, it's the branch-command like you said.

BUT there is one big point that constantly annoys me when I'm looking around in the support-boards.

Everyone. Please, PLEASE STOP confusing newcomers with your knowledge based on completely different versions of RPG Maker (it's hard enough to help people in the board for RPG2000/2003 combined sometimes in specific cases if they don't mention in advance which one they are using). Mentioning selfswitches here (this is not the first time I'm seeing this) which were introduced with RPGXP creates more problems than it solves. This is frustrating.

I for my part don't know enough version-specific details to think I could give any helpful responses to most support-topics for RPGMV and RPGMZ, I expect the same from everyone else. It's not always as easy as comparing Ace with MV which are almost the exact same thing UI-wise.

~炬燵あ
Sorry but... STOP IT, for real. It's nice that you want to help, parts of what you say are still true.
You could instead choose to post politely. Not everyone on these boards has been using RPG Maker for 20 years or more - since self switches have been been a part of the software since 2005, according to you, and so much of the editor has essentially not changed, it's a very easy assumption to make that self switches are applicable.

If someone gives advice that's incorrect, you know what you can do? You can calmly and politely say "Actually, that feature wasn't in this version." See how many words that takes?

There is zero reason for you to go on some four paragraph-long rant.
Personally I agree with Akira though, that it's not a great idea to post answers in subforums dedicated to a software that you don't know and haven't used, with information that's valid for a different software (and not stating that you are just guessing and don't really know).

Every engine is different, there are features one has that the other hasn't, or the other way round, or they may work differently, or the same way may have different performance implications in different versions. Especially for people new to the software it can be quite confusing if information is given that's not fitting to the engine they use. It may lead them down a frustrating rabbit hole. (For instance, googling "self switches rpg maker 2003" will make you find various tutorials how to implement something like that, in advanced and roundabout ways, which is not what the poster needs here at all.)

The four-paragraph-long rant is surely uncalled for as response to a single post like that, but it's actually a response to many such posts, from what I understand, and also addressed to "everyone" and not just you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-different-npc-dialogue-that-loops-and-doesnt-loop.148709/