Simple question: Can you play a SE during a text window using an escape code?

I'd just like to know if there's a way in MV, or a plugin, that'd let you do something like this:

You hear a loud \SE[Gun.ogg] BANG in the other room.

That way the player would hear a sound at the appropriate time during the dialogue/narration.
I'd hate to do-

Show text:
You hear a loud-

Play SE: Gun.ogg

Show text:
BANG from the other room.

But I will if I must. Just curious!
😩

[Also sorry if this is in the wrong section! Still learning to navigate the forums!]
Are you using auto-run or parrelle process for the narration event?
Are you using auto-run or parrelle process for the narration event?

It'd most likely be an Autorun, as it's a large room driven by character choices and narration, with sounds here and there. But if this could be done with parallel, I could make that work instead. Why do you ask? :0
You would need a plugin. I don't know if any exist, but Yanfly's message plugins would be a good starting point for your search.
You would need a plugin. I don't know if any exist, but Yanfly's message plugins would be a good starting point for your search.
Took a look through Yanfly's message core and the extensions, I thought there was something there too, but I guess I was mistaken? There might have been such a feature back in the VX Ace days, but if it's in Yanfly's systems, I can't find it. :<
It's a bit of a long workaround, but you could use the Extended Message Pack 1 with letter sounds:

\lson to turn letter sounds on
\lsn<Gun> to set the letter sound to Gun (I didn't check to see if this is an SE but I assume it is)
B (so the gun sound plays at the start of BANG)
\lsoff to turn letter sounds off
ANG (for the rest of the word)

So your message text would be:
You hear a loud \lson\lsn<Gun>B\lsoffANG in the other room.

That's really nice, and I think I might use the idea in my project too. It probably wouldn't take much though, to write a patch.
It's a bit of a long workaround, but you could use the Extended Message Pack 1 with letter sounds:

\lson to turn letter sounds on
\lsn<Gun> to set the letter sound to Gun (I didn't check to see if this is an SE but I assume it is)
B (so the gun sound plays at the start of BANG)
\lsoff to turn letter sounds off
ANG (for the rest of the word)

So your message text would be:
You hear a loud \lson\lsn<Gun>B\lsoffANG in the other room.

That's really nice, and I think I might use the idea in my project too. It probably wouldn't take much though, to write a patch.
I thought of that workaround too! The only problem with it being I'm pretty sure the text sounds cancel each other.
Example: the line of dialogue that brought this to my attention goes as such:

You sigh and tug your cloak \SE[ClothClench] tighter around your shoulders.

The ClothClench sound is a few seconds long.
So if I did the above workaround, the sound would play for a few frames, but then be stopped/overwritten by the cursor text sound effect going back to normal. It'd get cut off mid-sound.

You COULD finesse a work-around using the text SE, but it'd be really trial-and-error. Not to mention, if you don't have the text SE going every 1 character [mine makes a text sound every 7 characters], then you'd have to hope your 1 character SE-change would be timed correctly.

I'm curious about the possibility of a patch! You're right, it doesn't seem like it'd be too difficult of a snippet to write-in. Though I'm not experienced in the ways of coding, so I could just be talking out of my bum.
the sound would play for a few frames, but then be stopped/overwritten by the cursor text sound effect going back to normal. It'd get cut off mid-sound.
Are you sure about that? Did you test it? I'd expect it'd allow the sound to play for as long as needed, unless another sound was triggered. I wouldn't expect \lsoff would stop any sounds currently playing - just that it would prevent any new ones for subsequent letters.
Message codes (such as \. and \^ ) can be used to time the text's appearance within the message box. (You can hover over the "Text" label for a few seconds while writing a Message Box to see the list of codes, I think.)

If you are creative about timing a second event (Parallel Process event - just be careful to turn the PP event off right after you use it because it can cause lag if you don't), perhaps by turning ON a Switch that the PP event requires to activate right before the Message Box is displayed, then you can start a Wait command in the PP event at exactly the same time, and time the Wait command so that the Play SE command that comes after it will be timed perfectly to the appearance of the "BANG!" text.

Example:
Event 1:
(Any event body you like)
Control Switches: Turn Switch 16 ON
Show Message: You hear a loud... \^BANG!\.\. from the other room.
(Any other event body you like)

Event 2: Parallel Process, requires Switch 16 to be ON
Wait: 60 frames
Play SE: Gunshot
Control Switches: Turn Switch 16 OFF (which turns this PP event off)
I'll test it and report my results! @Shaz

-----------

Oh hey! I was misremembering the previous Text-Sounds-Plugin I used, which didn't let previous sound cues overlap each other. They all interrupted one another, making longer text SE's impossible.

I tested this out, and it does definitely work. It iiiiis a little bit clunky though, as making one sound effect appear at the right volume, pitch, etc, looks something like this:
You hear a loud \lsi[1]\lsn<laser2>\lsv[50]\lpi[100]B\lsi[7]\lsn<text>\lsv[50]\lpi[150]ANG from the other room.
Which is... yeah it's a bit clunky heh.; I CAN save some time by making a 'return text sounds to normal' macro, but it'd still look ike this for every SE I put in:
You hear a loud \lsi[1]\lsn<laser2>\lsv[50]\lpi[100]B\defaulttextANG from the other room.


You'd think there'd be a plugin already to just put, like, \playsound[filename] or \SE[filename] or something. :0
Man I woulda said Yanfly's plugins as well but if that's a no-go then I'd recommend finding another workaround with a message sound effects plugin

Here's one that I haven't tried, it could work
Man I woulda said Yanfly's plugins as well but if that's a no-go then I'd recommend finding another workaround with a message sound effects plugin

Here's one that I haven't tried, it could work

Thankfully Yanfly's does work, but it's pretty clumsy.
I tested this out, and it does definitely work. It iiiiis a little bit clunky though, as making one sound effect appear at the right volume, pitch, etc, looks something like this:
You hear a loud \lsi[1]\lsn<laser2>\lsv[50]\lpi[100]B\lsi[7]\lsn<text>\lsv[50]\lpi[150]ANG from the other room.
Which is... yeah it's a bit clunky heh.; I CAN save some time by making a 'return text sounds to normal' macro, but it'd still look ike this for every SE I put in:
You hear a loud \lsi[1]\lsn<laser2>\lsv[50]\lpi[100]B\defaulttextANG from the other room.


You'd think there'd be a plugin already to just put, like, \playsound[filename] or \SE[filename] or something. :0
I have a "custom escape codes" plugin that lets you define your own message codes with some scripting. It has a "play SE" example in its help description so you don't need to figure out the code yourself~ 😮‍💨

Here's a link if you want to check it out: view/download Cae_CustomEscCodes (Google Drive). 🙏
I have a "custom escape codes" plugin that lets you define your own message codes with some scripting. It has a "play SE" example in its help description so you don't need to figure out the code yourself~ 😮‍💨

Here's a link if you want to check it out: view/download Cae_CustomEscCodes (Google Drive). 🙏
Awesome, this worked for just what I needed! 😀 Setting it up was a little confusing, but I got it in the end ^^
Hey @Shaz you should pick this up to if you're still interested in implementing this in your games!

Consider this thread solved. :>
I'll probably just roll my own 🙂

To have a thread closed, you need to report your first post and let the mods know it's solved. They'll close it for you.
Thread closed c

Original thread: https://forums.rpgmakerweb.com/threads/simple-question-can-you-play-a-se-during-a-text-window-using-an-escape-code.124253/