MZ Sound effects for opening, closing, and advancing text boxes?

I've been told that the only way to do this is by manually placing sound effects before, between and after each text box. However, this would be a really big time sink and I would have to go back and retrofit a ton of messages.

Would it be reasonable to ask if anyone could whip up a plugin that plays SFX upon the text box opening, advancing to the next text box, and then closing?
Hi there!
You can do that with my free plugin Message Manager:

Or with my Message Common Event:

All my plugins need my core plugin somewhere above them:
Hi there!
You can do that with my free plugin Message Manager:

Or with my Message Common Event:

All my plugins need my core plugin somewhere above them:
Thank you so much, but where in this plugin settings can I find the sound effect options?
Thank you so much, but where in this plugin settings can I find the sound effect options?
My bad! Is just the EliMZ_MessageCommonEvent that would work for you. You can setup a before and after common event. With that, you can play any sound with the common event
I've been told that the only way to do this is by manually placing sound effects before, between and after each text box. However, this would be a really big time sink and I would have to go back and retrofit a ton of messages.

Would it be reasonable to ask if anyone could whip up a plugin that plays SFX upon the text box opening, advancing to the next text box, and then closing?
You don't need a custom plugin for this. VisuStella MZ Message Core has built-in options for open, next, and close sounds. Yanfly's Message Core for MV does the same. If you're not using those, a simple plugin would still be easy to make. Check the plugin request section—someone might have already done it.
You don't need a custom plugin for this. VisuStella MZ Message Core has built-in options for open, next, and close sounds. Yanfly's Message Core for MV does the same. If you're not using those, a simple plugin would still be easy to make. Check the plugin request section—someone might have already done it.
I will check this Yanfly one out as well.
I've been warned against using VisuStella since apparently you can't see the code, and we want a fair few plugins so that wouldn't work for us.
Yanfly is for MV though it might work with Fossil. Didn't spot options in VS Message Core of setting SEs like that (edit: but maybe there are ones?).

Anyway, you should clarify if you want 3 different SEs for open, close and "continue" or just same SE for all those cases? If it's same for everything, it's just simple edits of two methods I think. If you want different ones, I guess you'd have to check the interpreter what is the next command so you can differentiate between continue and close.

edit: Or actually maybe you can just check $gameMessage.hasText() because that seemed to return true even when it's an empty text box.
Yanfly is for MV though it might work with Fossil. Didn't spot options in VS Message Core of setting SEs like that (edit: but maybe there are ones?).

Anyway, you should clarify if you want 3 different SEs for open, close and "continue" or just same SE for all those cases? If it's same for everything, it's just simple edits of two methods I think. If you want different ones, I guess you'd have to check the interpreter what is the next command so you can differentiate between continue and close.

edit: Or actually maybe you can just check $gameMessage.hasText() because that seemed to return true even when it's an empty text box.
I am after a method of playing all 3 of those sound effects, yes
I think this works (copy paste to notepad, save as .js file and add as a plugin). Change the SEs to what you like. But yeah, there's cases like if you change the position of the message box from like bottom to middle, then that doesContinue no longer counts, so it counts it as opening (edit: actually closing) instead of continuing. Though of course it actually does close and open in that situation.

const _myEdit1_WindowMessage_newPage = Window_Message.prototype.newPage;
Window_Message.prototype.newPage = function(textState) {
_myEdit1_WindowMessage_newPage.call(this, textState);
if (this.isClosed()){
AudioManager.playSe({
name: 'Bell1',
volume: 100,
pitch: 100,
pan: 0
});
} else {
AudioManager.playSe({
name: 'Buzzer1',
volume: 100,
pitch: 100,
pan: 0
});
}
};

const _myEdit1_WindowMessage_update = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
if (this.isOpen() && this.isClosing() && !this.doesContinue()) {
AudioManager.playSe({
name: 'Cow',
volume: 100,
pitch: 100,
pan: 0
});
}
_myEdit1_WindowMessage_update.call(this);
};
I think this works (copy paste to notepad, save as .js file and add as a plugin). Change the SEs to what you like. But yeah, there's cases like if you change the position of the message box from like bottom to middle, then that doesContinue no longer counts, so it counts it as opening (edit: actually closing) instead of continuing. Though of course it actually does close and open in that situation.

const _myEdit1_WindowMessage_newPage = Window_Message.prototype.newPage;
Window_Message.prototype.newPage = function(textState) {
_myEdit1_WindowMessage_newPage.call(this, textState);
if (this.isClosed()){
AudioManager.playSe({
name: 'Bell1',
volume: 100,
pitch: 100,
pan: 0
});
} else {
AudioManager.playSe({
name: 'Buzzer1',
volume: 100,
pitch: 100,
pan: 0
});
}
};

const _myEdit1_WindowMessage_update = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
if (this.isOpen() && this.isClosing() && !this.doesContinue()) {
AudioManager.playSe({
name: 'Cow',
volume: 100,
pitch: 100,
pan: 0
});
}
_myEdit1_WindowMessage_update.call(this);
};
Thank you so much for this!

It almost works, but it plays all 3 sound effects one after the other upon a new message box appearing (whether from being newly opened or from progressing to the next box), instead of them each playing at their respective moment. That's the best I can explain it, does it make sense?
Hmmm I mean I tested it and it seemed to work for me. Do you have other plugins that affect message box? Turn them off and see if it works. Though I have to wonder what kind of plugin would return true for this.isClosing() when you first open a message box.
Hmmm I mean I tested it and it seemed to work for me. Do you have other plugins that affect message box? Turn them off and see if it works. Though I have to wonder what kind of plugin would return true for this.isClosing() when you first open a message box.
Sorry for the late response.

The only other plugin related to message boxes is Theo_TypingSoundMZ, and MAYBE EliMZ_Book because I don't know what's in it. I turned them both off, and the MessageSFX plugin still plays all 3 sound effects one after the other instead of playing them on open, progress, and close. Do you have any ideas? Thank you for your patience and for working with me on this, again!
Like I said, seems to work for me (though I only tested showing text boxes in succession) with no other plugins or with VisuStella cores.

Do you have some other event commands between the text boxes, like moving a bust or whatever? Other than that, all I can suggest is turning off all other plugins (fast in MZ) and testing if there's something affecting it.
Like I said, seems to work for me (though I only tested showing text boxes in succession) with no other plugins or with VisuStella cores.

Do you have some other event commands between the text boxes, like moving a bust or whatever? Other than that, all I can suggest is turning off all other plugins (fast in MZ) and testing if there's something affecting it.
I managed to get it working actually! Thank you so much, it's exactly what I was looking for!
Like I said, seems to work for me (though I only tested showing text boxes in succession) with no other plugins or with VisuStella cores.

Do you have some other event commands between the text boxes, like moving a bust or whatever? Other than that, all I can suggest is turning off all other plugins (fast in MZ) and testing if there's something affecting it.
Just one more thing I'd like to ask, and this is not a big deal if it's more trouble than its worth. Is it possible for the open/close sound effects not to play if the text window behind is set to transparent?
If you want transparent not to play it, I think you can add checks for the backgrounds like below.

But these edits I've made don't take into account if you keep mixing different bg types in succession, because then the message window will keep opening and closing I think. You'd need heavier edits to account for all cases.

const _myEdit1_WindowMessage_newPage = Window_Message.prototype.newPage;
Window_Message.prototype.newPage = function(textState) {
_myEdit1_WindowMessage_newPage.call(this, textState);
if (this.isClosed()) {
if ($gameMessage.background() !== 2) {
AudioManager.playSe({
name: 'Bell1',
volume: 100,
pitch: 100,
pan: 0
});
}
} else {
AudioManager.playSe({
name: 'Buzzer1',
volume: 100,
pitch: 100,
pan: 0
});
}
};

const _myEdit1_WindowMessage_update = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
if (this.isOpen() && this.isClosing() && !this.doesContinue() && this._background !== 2) {
AudioManager.playSe({
name: 'Cow',
volume: 100,
pitch: 100,
pan: 0
});
}
_myEdit1_WindowMessage_update.call(this);
};
If you want transparent not to play it, I think you can add checks for the backgrounds like below.

But these edits I've made don't take into account if you keep mixing different bg types in succession, because then the message window will keep opening and closing I think. You'd need heavier edits to account for all cases.

const _myEdit1_WindowMessage_newPage = Window_Message.prototype.newPage;
Window_Message.prototype.newPage = function(textState) {
_myEdit1_WindowMessage_newPage.call(this, textState);
if (this.isClosed()) {
if ($gameMessage.background() !== 2) {
AudioManager.playSe({
name: 'Bell1',
volume: 100,
pitch: 100,
pan: 0
});
}
} else {
AudioManager.playSe({
name: 'Buzzer1',
volume: 100,
pitch: 100,
pan: 0
});
}
};

const _myEdit1_WindowMessage_update = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
if (this.isOpen() && this.isClosing() && !this.doesContinue() && this._background !== 2) {
AudioManager.playSe({
name: 'Cow',
volume: 100,
pitch: 100,
pan: 0
});
}
_myEdit1_WindowMessage_update.call(this);
};
Ingame I'm only using a generic window BG and a transparent BG, will I be okay?
Well you can just test it 😀 Check if there's cases in your game where it behaves how you don't want.
Well you can just test it 😀 Check if there's cases in your game where it behaves how you don't want.
It appears to be working like a charm! Thanks so much for all the help.
Well you can just test it 😀 Check if there's cases in your game where it behaves how you don't want.
One more small thing-sorry, I keep finding things I wish to tweak and I'm useless at Java at the moment so the best I can do is ask. Would it be possible to disable the "text advance" sound when picking a yes/no option? Yes/no options have their own SFX when selected, so it plays both "text advance" and "option select" on top of each other.

Again if this is more trouble than its worth it's totally okay, you've already helped me way more than I expected you to

Original thread: https://forums.rpgmakerweb.com/threads/sound-effects-for-opening-closing-and-advancing-text-boxes.183718/