(Solved) Name based special dialogue

I want to make lines of dialogue that only appear when the player has chosen a specific name. For example, an npc is talking and they normally have lines A, B, and C that they say when the player has any given name, but when the player is named Tom their dialogue changes to A, B, and D, or E, F, and G. I know Toby Fox did it with Undertale (though it was only during the naming process) and ConcernedApe did it with Stardew Valley (but it was just a certain line that can be repeated). I assume this can be done with other event types as well.
Just for the sake of clarity, this reads as if the player must choose a name from a pre-defined list, or else you would have no way of knowing whether the actor is named Tom or Henrietta.

One way of doing this (though it would entail a fair bit of work) would be to use the 'Show Choices' command, with each possible name listed as a potential choice. In each section if the player chooses that particular name, a switch is turned on - obviously a different switch for each name. For the sake of this example we will say switches 21, 22 and 23.

In the event for a dialoge NPC, you would have a series of nested conditionals.
Is switch 21 ON?
If yes - A, B, C
Else: (then a new conditional)
Is switch 22 ON?
If yes - D, E, F
Else: D, F, G
Additionally, you might want to search tsukihimes blog for her Ace scripts.
She has a script for conditional choices that would solve your problem without conditional branches.
Would it necessarily have to be a set list of choices though? In Undertale, which is the best example that I know of, the player has the option of any combination of letters for their name. For most names you get the standard response of "Is this name correct?", but there are certain names that, when used, have different responses, e.g. Sans is "nope." and Chara is "The true name." So I was thinking along the lines of that. The player can input any name they want, but certain names, chosen beforehand, receive their own special dialogue. So basically a 'if name is X, Y, or Z, then special dialogue happens, else regular dialogue' kind of thing.
How realistic is the expectation that players will just happen upon the one 'true' name out of the many, many thousands that they could pick? It seems that you are setting out to do quite a bit of extra work for almost zero reward. Either that or expecting the player to be a bit of a mind reader or play Guidedangit. Will you be giving any clues about which is the 'true' name? If there is a 'true' name, isn't that just a backdoor way you, the dev, have for deciding the name anyway?
I mostly want to leave some easter eggs for people with specific names. For example, my first name is Jonathan, a very common name, and I want to leave little messages for those with that name, or poke fun at people fro using silly names. There is also someone specific I will have play it and I want things for him to find.
why not just set a name to a variable, and set the player name to the same variable. If the two variables are equal, have special dialogue trees.
Ok, but how do I do that? The only experience I had with coding was about five or six years ago for a semester in high school using C++. We didn't do a lot with it, but even then I've probably forgotten everything I did know.
I think I might have a better solution. I'm pretty sure you want a naming system where the player is allowed to input any name they want, but if they input a specific name like, "Dummy", they get a different response. I actually learned how to do this recently!

First, go into the Event Commands and find Name Input Processing. Input the actor who's getting named, either your main character, or even someone else, and give your player as many available characters as you see fit, as long as it's as many or more than the name you already gave them.

Now that you've done that, go to Event Commands again and find Conditional Branch. Go to the Second tab and input the actor who's name is getting changed or given. Now go to Name and input the name that will change the dialogue, ex. 'Dummy". Make sure you keep in mind any spaces and capitalization's will have to be replicated exactly for the name to be recognized. For example, if someone typed "dummy" and you put in "Dummy' with a capital "D" it wouldn't work. Now, if you want the character to receive the chosen name, just go to Event Commands again, find Change Actor Name, and select the actor whos name is getting and change it!

Now, just type in whatever dialog you want to happen when the chosen name is invoked! In the Else area, put in whatever dialog would have occurred if they had been given any other name. I like to use this for jokes like if people try to put profanity as the characters name, but you can use this for a whole bunch of cool ideas and puzzles.

I hope this helped, good luck on whatever you're working on!
That is exactly what I wanted. Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/solved-name-based-special-dialogue.89001/