Easier way to transition between message windows?

Hey everybody,


I'm currently solving an issue in my game which feels like a very roundabout way of doing it. Wondering if maybe there's an easier way that I'm not considering?!


Here is an imgur gallery I made which I think illustrates it: http://imgur.com/a/K6QG8


Basically, by using a 'wait' command inbetween message speakers, I'm able to have RPG Maker do a nice little window close / re-open transition. But this means putting in a 'wait' command inbetween speakers throughout my entire game...!


The other problem, of course, is that you would only want this when you cut from one speaker to another. If the same speaker is continuing to speak over multiple message boxes, you would not want the window to close and re-open: You'd want it to simply erase and keep writing, the way it currently does between speakers by default.


So yes: Is there an easy way to do this? Or would it require a plugin? 'Speakers' are denoted in my game (and for everyone else, I'd think) based on the portrait being used. So the logic of it would basically be: If the 'Face' image is not the same as used in the preceding message box, then wait 1 frame.


Or it could do something more elaborate, but just putting in a 'wait 1 frame' automatically seems like a smart way to trick RPG Maker into it. 🙂


If anyone has any thoughts, I'd love to hear them! Thanks! If you take a look at the imgur gallery, I think you'll agree that it's a subtle but very nice effect...
It'd have to be done with scripting, but it's only a couple extra lines added to Window_Message.


Inside Window_Message.prototype.loadMessageFace, add these two lines to force the message box to remember what face was drawn.


this._currentFace = $gameMessage.faceName()
this._currentIndex = $gameMessage.faceIndex()




Then inside Window_Message.prototype.areSettingsChanged, add these two lines inside the return( ... ) to make the message box check if the incoming message uses a different face.

Code:
|| this._currentFace !== $gameMessage.faceName()
|| this._currentIndex !== $gameMessage.faceIndex()
It'd have to be done with scripting, but it's only a couple extra lines added to Window_Message.


Inside Window_Message.prototype.loadMessageFace, add these two lines to force the message box to remember what face was drawn.



this._currentFace = $gameMessage.faceName()
this._currentIndex = $gameMessage.faceIndex()




Then inside Window_Message.prototype.areSettingsChanged, add these two lines inside the return( ... ) to make the message box check if the incoming message uses a different face.



|| this._currentFace !== $gameMessage.faceName()
|| this._currentIndex !== $gameMessage.faceIndex()



Hey Resonance,



Thanks very much! This worked perfectly! I'm not a JavaScript pro, so I had to futz a bit with understanding how you intended these to be placed - for anyone else trying and wondering why they can't quite get it to work, here are steps:


1. Go into the 'js' folder in your project, open up 'rpg_windows' in a good editor (I love Notepad++, personally!)


2. Use (F)ind to quickly locate 'Window_Message.prototype.loadMessageFace' and 'Window_Message.prototype.areSettingsChanged' (they aren't far apart)


3. Insert the stuff above so that it is placed as such: http://imgur.com/a/v9wmg


IMPORTANT NOTE: There is one issue with how this works - because it references based on face files, if you change emotions inbetween two lines of a character - i.e. they say something with their 'happy' portrait and then they immediate say something with their 'crying' portrait - the message window will close and redraw as if it were two different characters.


Resonance, can you think of any expansion to your logic here that might prevent this...? I'm only using single-emotion portraits right now, but I'll almost certainly be changing that down the road.


Thanks again!
Good job getting it to work. lol


For the emote issue, one solution is that you could check for only the faceName and get rid of both lines related to the index.


Normally you'd check the index as well, because there can be multiple characters in a single faceset file. This means you'll have to have separate image files for each character. This might already be the case for you, because that's how emotion sets are generally released.

Original thread: https://forums.rpgmakerweb.com/threads/easier-way-to-transition-between-message-windows.64278/