NPC knows your name.

Thought I saw this posted and/or solved somewhere... took hours to sort through all the posts I've already read, but again I couldn't find it.

Basically I want an NPC to call out to the Actor by his/her name which is user inputted...input....you know what I mean. I saw the character \N[n] in the text box under Events - I should have mentioned that, the NPC calls Actor by name in an Event - but it comes out just [n] when I test play, so obviously that's not the proper use for that.

Anywho, do I need a script for this?

Also, what is the use of the \N[n] function in the text box? Am I assuming that you place a name in the brackets?

Thanks for the help!
the lowercase n should be the ID of the actor.

So \n[1]. 
No, n is always an abbreviation for "any number".


In this specific case, the text code \N[n] is "replaced by the name of the nth actor" - as said in the tooltip of the text box of the show text command.


You need to replace the n with the ID/number of the actor whose name you want at that position.


If you want the name of the 7th actor, you need to write \N[7] for example.
Oh, derp! That makes sense. I knew it said nth actor, so I'm not sure why my brain didn't catch that.

So that works for when a person inputs any name, you just get the ID number of the actor and place it in the brackets.

Then is there a script/event to find the proper actor ID# (since the user can pick any actor), then place it into \N[n]?
That would need conditional branches.
Then is there a script/event to find the proper actor ID# (since the user can pick any actor), then place it into \N[n]?
Control Variable : Game Data : Party Member #1 : actor ID (or whichever member you need the actor number from)
then inside the text use \N[\V[varID]]


(Instead of varID you need to place the ID number of the variable where you stored the actor-ID with the variable command before the show text)


Yes, you can use the \V-code for variable value to redirect other text codes, no need for conditional branches in that case.
Ah, nice!

Thanks Andar, that worked perfectly! Playtested that on my 3 chars and it works perfect every time. Very handy, thanks!
If you want the name of the party leader (first member), just use \P[1]

Original thread: https://forums.rpgmakerweb.com/threads/npc-knows-your-name.42497/