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?
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 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);
};
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.
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.
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);
};
Well you can just test it 😀 Check if there's cases in your game where it behaves how you don't want.