MV Turn on/off a Switch when opening the menù

Hello again Forum! is that possible ? I need it only for a specific map
beacuse i put a blacksmith with hammer audio, and i need to silence it when i open the menù (BGS not SE).
With event map is preety easy so that didnt happen when i talk to him for shop. But i didnt know how did that, when the player open the menù ( Menù/escape Yanfly keyboard config )
I had a similar issue a while ago for a plugin that I wanted to be able to trigger a common event when/before the menu opens, here was the JavaScript answer 👋

I'm still working on the plugin, as it's to have a bunch of different in-game "triggers" to run common events besides just menu opening, and I've kind of put it on the back burner because of school. But if you need help with tweaking the code in that thread to implement for your purposes, I'd be happy to talk you through it, or perhaps pull that part of the code to make a mini version of the plugin for you to use (if I can find time 🙂 )
I had a similar issue a while ago for a plugin that I wanted to be able to trigger a common event when/before the menu opens, here was the JavaScript answer 👋

I'm still working on the plugin, as it's to have a bunch of different in-game "triggers" to run common events besides just menu opening, and I've kind of put it on the back burner because of school. But if you need help with tweaking the code in that thread to implement for your purposes, I'd be happy to talk you through it, or perhaps pull that part of the code to make a mini version of the plugin for you to use (if I can find time 🙂 )
Thanks! i will take a look, i think i can use a common event too, the big problem is only the possibility of DOING SOMETHING xD after the menu open up
Thanks! i will take a look, i think i can use a common event too, the big problem is only the possibility of DOING SOMETHING xD after the menu open up
For sure! And where that line of code is in my version that reserves a common event, if you wanted you could just replace that with whatever you want. Perhaps an "if" statement checking for the correct map, and then if that's true, directly stop the BGS (if you know the script call - should be easy to find in the master Google Docs list). That way it wouldn't have to run a common event to check what map you're on every time you open the menu, may help prevent lag.

Original thread: https://forums.rpgmakerweb.com/threads/turn-on-off-a-switch-when-opening-the-menu.152363/