Set Variable Depending on Active Face

Hey! 👋

I was wondering if anyone could help make a a small script.

In my project, I have a separate message sound play depending on who is talking, determined by a variable. Normally, I have to manually set this before every text box of every event, but I was hoping I could have this variable automatically set depending on who is talking.

Pretty much, I'd love to have the script check which face is being used (before the text actually starts to scroll). If the face (filename, index) is defined in the script, set the variable to X, otherwise don't to anything.

I hope I explained this in a way that makes sense. Please do ask if you have any questions though.

Thank you! 😤
I think this is very doable, though it might be even easier if the script had you set the sounds to play, and played those sounds. Would take an edit to how message windows are played, which is my weak area, but I kinda see how to write it.

I may dabble in it this weekend and see where it goes. But if someone else can do it faster or better go ahead.
Hey, thanks for taking a look at this. 🙂

As reference, here's the script I'm using, in case an edit would be easier.

https://www.rpgmakercentral.com/topic/607-text-sound-effect-updated/
@Vis_Mage We prefer Members to post a link to the script rather then post the whole script for several reasons. We can be sure that it is the most recent version, many scripters don't allow reposting, the webpage might contain useful additional information or discussion.

Original thread: https://forums.rpgmakerweb.com/threads/set-variable-depending-on-active-face.95603/