What if, for whatever reason, you’d like the character’s name to be a different colour each time you speak to an NPC?
You’ll only need one variable (let’s call it Randomize) and one NPC event with two Command Events in it, thus:
@>Text: Heya, c[v[1]]n[1]c[0], how’s it going?
@>Text: -, -,Normal, Bottom
: :Heya, c[v[1]]n[1]c[0], how’s it going?
@>Display Text: -, -,Normal, Down
: :Heya, c[v[1]]n[1]c[0], how’s it going?
The second displays a message with some "control characters" inserted. Control characters are letters or punctuation marks preceded by a backslash – there are 12 in total in RM2K3 and some additional ones in RMXP/VX/VXA definable through scripting. The ones we need are for inserting the colour (C), the name (N) and the variable containing the random number (V). The basic format, for example, would be N[1], which would display the name of the first Hero in the Database.
We’ll be using "nested" control characters (control characters contained within control characters) to display the name of the first Hero in the list (in the Database) in the randomly selected colour.
This is how the nested control characters fit together, split into four parts:
Of course, this can be done with other things too, as long as the same format is followed. This will also work in RMXP/VX/VXA, but other colours can be added in via script (in Window_Base under the text_color method).
You must log in to post a comment.