MV Yanfly message name window call name by party position name

Hello everyone! I'm trying to event a message with the Yanfly message system. I want the message to be showing the face
of the first actor on the party by position, and that's successfully executed by \pf[1]. But now to show also the name, I have to put a substitute for the x variable, but if I put \pf[1] it just shows the text. What is the variable to be called here to display the relative name actor by party position?


\n<x>\pf[1]Hello
Why are you putting it in angled brackets? Also, you're using the wrong escape code. \n is for the actor ID, if you want the name of a party member you'd use \p. If you put \p[1]\pf[1] you'll get the name and face of party member 1.
Thanks it works now with the code:

\n<\p[1]>\pf[1]

It displays in yellow, is there a way to change the colour randomly?
Have you tried using the color escape code, \c? If that doesn't work in the name box for some reason, it would be pretty trivial to ask for help for a little plugin to change it.
\n<name> is a text code added by YEP Message Core. It uses <> instead of [] to allow use of default text codes, e.g. \P[x], in the name. Plugin link, for reference:

Like ATT_Turan says, you can use the \c[x] text code to change the text to colour x. Check the bottom-right of your system/Window.png for the colours: first colour is 0.

You can change the Name Box Added Text plugin parameter to change the name's colour. By default this is \c[6], i.e. "change the text to colour 6".

To change the colour "randomly", maybe try something like \c[\v[123]], i.e. "change the text to colour (value of variable 123)". You could then set that variable to a random number every so often...not sure if that works for you. 😴

Alternatively you could find a plugin that lets you run some script via a text code, e.g. one of these:
  • YEP Message Eval Text - has an \evalText<<code>> text code, I guess you could do this:
    • \c[\evalText<<Math.randomInt(32)>>]
    I.e. change the text to a random colour from 0~31.

  • Cae_CustomEscCodes - lets you design/script your own text codes, e.g. try a Convert code with a replacer like this:
    • return "\x1bc[" + Math.randomInt(32) + "]";
\n<name> is a text code added by YEP Message Core.
Yeah, I realized what he was doing by the second post 😛 I just mentally spaced in my first reply, forgetting that these codes were just supplying the names of the actors, not placing them in the name box.
very nice! Thanks for the comprehensive help

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-message-name-window-call-name-by-party-position-name.140393/