Text Codes Not Working Within Script Variable

Derex000

Veteran
Veteran
Joined
Jan 4, 2016
Messages
41
Reaction score
85
First Language
English
Okay to summarise my problem I want to use text codes within the text generated by a variable script. So for example when I set Variable 1 to Script and I write the script as "She screamed,\\. he looked horrible!" I want that text code to be called so it pauses for a fraction of a second. Or in other situations change colour or so on. Basically use a text code. From what I've seen after spending hours googling this, it should be possible? I think? That or I'm misunderstanding something?
I'm using RPG Maker MV and the only added plugin I have is Yanfly's Message Core plugin. Using that I call on variables from within a text box. So in a text box I would write: \v[1]
Instead of the text code working, what happens is the message box reads: She screamed,\. he looked horrible! The message box just refuses to use the text code if it's done by a variable script. Am I missing something here? Why won't it read the text code? Is it because I called it using the \v[n] text code? Is it even possible to use a text-code from within a variable script? Would really appreciate some help because if I can figure this out it would save me ages of grief. I've been Googling this for hours but can't find anything so I must be missing something here.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,637
First Language
Czech
Primarily Uses
RMMV
It won't work without a custom plugin. The message box runs through the characters inside of your message box and essentially says
"If you see an escape code, interpret it, then carry on."
So it will replace your \v[1] with the contents of the variable, then carry on, completely ignoring the text inside of the variable as it's already behind it.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,044
Reaction score
1,474
First Language
EN
Primarily Uses
RMMZ
It's fine, \v[x] is a "convert" code (pre-message) and \. is a "process" code (mid-message). You just need to use \x1b instead of \\, since the default code pre-converts all backslashes to the \x1b escape character. E.g. Control Variables > Script:
Code:
"Hi! \x1b.How's things?"
 

Derex000

Veteran
Veteran
Joined
Jan 4, 2016
Messages
41
Reaction score
85
First Language
English
@caethyril Thank you so so so much! I tried your suggestion and it worked! Seriously you're an absolute angel this has made making my game 100x easier. I was up till 4 AM last night trying to figure this out and posting on here was my last hope. I'm making a game that's entirely text based so everything works through variable scripts so being able to use text codes within scripts is so so huge. Literally cuts all the events I need to make in half. Seriously thank you! I hope you're having an amazing day!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,044
Reaction score
1,474
First Language
EN
Primarily Uses
RMMZ
Great, happy to help! :kaojoy: And thanks; this morning was a bit rough but the rest of my day's been good~ :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

currently listening to Driftwood Gaming streaming some MZ dev time and it's delightful! had no idea they were this entertaining, love it
In quarantine, will be tested soon. This year is really something... special.
I was at another orientation yesterday and I realized I'll be working with an old friend! We met at the local water park a few years back and it was so nice to see her again! We had a chat, and next week when I officially start, I'll see if maybe we can trade our Zoom IDs so we can talk!
I made some sideview closets for MV!
You can find them in my MV resource thread.

Forum statistics

Threads
105,510
Messages
1,014,332
Members
137,197
Latest member
Nicole_cc
Top