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

Status
Not open for further replies.

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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!
:kaodes:

[Also sorry if this is in the wrong section! Still learning to navigate the forums!]
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
533
First Language
English
Primarily Uses
N/A
Are you using auto-run or parrelle process for the narration event?
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,075
Reaction score
13,691
First Language
English
Primarily Uses
RMMV
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.
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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. :<
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,075
Reaction score
13,691
First Language
English
Primarily Uses
RMMV
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.
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,075
Reaction score
13,691
First Language
English
Primarily Uses
RMMV
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,605
Reaction score
5,071
First Language
English
Primarily Uses
RMVXA
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)
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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
 

Cormorant42

Veteran
Veteran
Joined
Sep 17, 2019
Messages
113
Reaction score
54
First Language
English
Primarily Uses
RMMV
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
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,069
Reaction score
1,485
First Language
EN
Primarily Uses
RMMZ
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~ :kaophew:

Here's a link if you want to check it out: view/download Cae_CustomEscCodes (Google Drive). :kaothx:
 

VTDraws

Filthy Point-&-Click casual
Veteran
Joined
Apr 17, 2017
Messages
56
Reaction score
9
First Language
English
Primarily Uses
RMMV
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~ :kaophew:

Here's a link if you want to check it out: view/download Cae_CustomEscCodes (Google Drive). :kaothx:
Awesome, this worked for just what I needed! :D 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. :>
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,075
Reaction score
13,691
First Language
English
Primarily Uses
RMMV
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,605
Reaction score
5,071
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I think I've created a monster.
...and I love it. <3
Today represents my one year anniversary of throwing out the tile map. :LZSexcite: One year ago my game looked like...


And now for those that don't know, it looks like..


What a year, what a year indeed. RIP Tile Map, nobody misses you. :LZSwink:
There is now a demo released for [Beyond the Mirror]! Check the team recruitment thread to learn more!
'Tis the season to see shipping prices and go 'Yikes'.

Forum statistics

Threads
105,698
Messages
1,015,718
Members
137,383
Latest member
abcdrm
Top