Store text control characters in a variable and recall them in a text window

Hi everyone


Would like to know if it is possible to store text control character like \C[2]\P[1]\C[0] in a variable and then recall that variable in a text window?

For an example, I have an NPC with a text window that contains, Welcome back \V[2].

Then there is a common event on parallel that set variable 1 to the actor id of party member #1. then it uses conditional branches to determine what value variable 2 should have. Variable 2 is set using the option scrip with "\\C[2]\\P[1]\\C[0]"

Yet the NPC displays when you talk to him: Welcome back \C[2]\P[1]\C[0]". instead of Welcome back Harold.

I know that the common event sets the variable correctly because when i change actor the displayed variable content changes.
I don’t have any plugins active.

Is this even possible what I want to do? If yes, what am I doing wrong? If no, is there a plugin and if so any recommendations?
Kind regards
I'm not 100% sure, but coloring tag \c[] must be in lowercase, because in JavaScript:

var SampleVar
var sampleVar
var Samplevar
var SAMPLEVAR

are four different variables. Therefore tag \C[] might not be regognized by engine.
If this still won't help try then:

2021-08-08 19_28_50-ID_003 - Event Editor.png
it's like soulrender said, but color, variables van be both c or C,
I mostly use lowercase anyways, but code in variables always starts
with "1xb" in order to read them, c, p, s, etc can be used after that.
Read this thread for the explanation of above.
@Soulrender was posting at the same time I was. 🙂
Looks like @ShadowDragon beat me as well. 🙂
Many thanks to everyone. I tried it and it works.

That solves this problem. Thread can be closed
@Arthoras if it's solved, report your first post and place there closed being solved.
and the mod will close it for you.

while mods dont read everything, report is always noticed sooner or later 🙂
Thanks for reporting @Arthoras.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/store-text-control-characters-in-a-variable-and-recall-them-in-a-text-window.139378/