I am making a music-changing common event, and I only want it to change when you are in a certain map. No, not going into properties and setting the music, because this would only happen after you sleep in the Inn (which I made a switch). I want to pitch down the original themes of each map in this event.
How to set a common event to only run in a certain map?
RPG Maker MZ SupportActive a switch on an autorun>erase event whenever the player is on the map and deactivate it when they leave. Set switch as condition for common event.
You could just put an if statement in the common event checking the map id
I'm not quite sure what you mean. I don't know how to set it so an event can tell if I am in a map or not.
How do I make a statement that says this?
If:$gameMap._mapId==3
Or whatever the map number is
Or whatever the map number is
I will try that! Thank you!
If it's an event that's specific to a map, then you normally wouldn't make it a common event--you'd just make an event on the map in question.
If your player is on the map where the autorun event is, you don't need to tell the game anything. It just turns on the switch whenever the player is on the map. And on your exit events, you just turn the switch back off.
Ok! And I would just set the auto run event to condition the Inn switch?
You just make an autorun event that turns on whatever switch your common event is supposed to use, then put an "Erase event", that way, the event runs only once, but runs again should you return to this map. You common event then has the condition of this switch. On your exits you just turn off the switch so when the player leaves this map, the common event will stop.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-set-a-common-event-to-only-run-in-a-certain-map.163001/