How to end events when leaving a map.

I'm new to RPG Maker XP. In a map that I created, I have various events that can be triggered by the player however I dont know how to end these when leaving the map so the player can trigger it again. The events are sprite approaching the player(it says game over when it catches you) and BGM change. They are still around when I leave the map. Thank you. If theres already a thread on this, I highly appreciate a link to it.
I've moved this thread to RPG Maker XP . Please be sure to post your threads in the correct forum next time. Thank you.
@notmexicanjose The tutorials section is for posting tutorials you've written, and not for asking questions.


@Archeia Ninja mod.... >_>
What you're looking for are self switches.  Turn on a self switch at the end of the event, then add a new page and set the self switch as one of the page's conditions.  Don't make ANY other changes to the new page.


When the player activates the event, it will process, and will then "turn itself off" so it doesn't run again.
@Shaz I started all over again so I can do it step by step. So I created a new event, put self switching at the end of the event(I tried both on and off) and opened a new page then checked the self switch again for the 2nd page without changing the events for the second page. What happened is I almost the same as without self switching. The bgm turns off only when I went back the the map and not when I left the map.
Can you please take a screenshot of both event pages and post them here?  Use Alt+PrintScreen so it captures the full window, which will contain everything we need.
Can you please take a screenshot of both event pages and post them here?  Use Alt+PrintScreen so it captures the full window, which will contain everything we need.

This is what I understood from your explanation.

Page 1.png

page 2.png
Yes.  So you should find when you activate that event, you will not be able to activate it again, even if you leave the map and return.  That controls the BGM only - there's nothing in that event that controls any NPC.


I would question why you have an event with no graphic set to Action Button?  How is the player going to know there is something there to interact with and that they have to press space right on that spot?


Also, as I said, please use Alt+Printscreen to take screenshots.  We specifically only want to see the event window, not your entire desktop, as it makes the stuff we're interested in too small to read what's going on.
Yes.  So you should find when you activate that event, you will not be able to activate it again, even if you leave the map and return.  That controls the BGM only - there's nothing in that event that controls any NPC.


I would question why you have an event with no graphic set to Action Button?  How is the player going to know there is something there to interact with and that they have to press space right on that spot?


Also, as I said, please use Alt+Printscreen to take screenshots.  We specifically only want to see the event window, not your entire desktop, as it makes the stuff we're interested in too small to read what's going on.

Sorry I'm new. I tried the alt+Printscreen but nothing happened. The player looks like Its activating the drawer, although I forgot to put "Conditional Branch: Player is facing up"


So


What I want to do is to activate the event(should be the ncp and bgm, but I'm only doing a demo on bgm so its easier). If I leave the map, I want the bgm and the npc to stop so that when I enter back again and activate the 'event' the same thing happens. The bgm plays and the npc does whatever it did before(chasing me)
sorry - I thought you were trying to make it so they DON'T do the same things again.


If you want the BGM to end when you leave the map, simply set a new BGM for the map they're going to.  If you don't want any BGM on that map, leave the BGM name blank, but check the box above the BGM name (I can't get my XP running right now so I can't see what it's called).  That will force any currently-playing BGM to stop.  Then change your event back to the way it was before - remove the second page and remove the self switch command on the first page.


For the NPC chasing you, I'd need to see what your event looks like.  Alt+PrintScreen takes an image of the active window and puts it into the clipboard.  You then have to open something like MS Paint or Paint.net and paste it in and save it.
sorry - I thought you were trying to make it so they DON'T do the same things again.


If you want the BGM to end when you leave the map, simply set a new BGM for the map they're going to.  If you don't want any BGM on that map, leave the BGM name blank, but check the box above the BGM name (I can't get my XP running right now so I can't see what it's called).  That will force any currently-playing BGM to stop.  Then change your event back to the way it was before - remove the second page and remove the self switch command on the first page.


For the NPC chasing you, I'd need to see what your event looks like.  Alt+PrintScreen takes an image of the active window and puts it into the clipboard.  You then have to open something like MS Paint or Paint.net and paste it in and save it.

Ok I've solved my problem with the bgm using the method you gave me. Thank you very much.


I will post my progress with the npc later. I might have to take a break because I've been trying to learn things on rpg maker xp for hours since I woke up.
@Shaz OK this is the "NPC" part. These events works like this:


When I activated the switch, the bgm plays and the 'flame creature' chases me. When I exit the map, the bgm stops, but can be re-activated like I wanted it to be.


The problem is the "NPC" event never went away. I want to summon and re-summon it the same time I play the bgm.


What can you recommend?

Flame monster.png

Flame monster and bgm switch.png
then turn the switch off when you want it to disappear.  If this means when you leave the room, put it on the room exit event.
then turn the switch off when you want it to disappear.  If this means when you leave the room, put it on the room exit event.

Damn.


It was right under my nose the whole time.


I did a similar thing but Instead of turning the 'same switch' off with the exit, I made a second switch on the 'flame creature' event and added a switch for that. Which didn't work btw.


Thank you very much. All problems solved.
Make sure you name your switches.  Otherwise you're going to forget which ones you've used and you'll use the same switch for two or more different things.  That is a nightmare to debug!
Make sure you name your switches.  Otherwise you're going to forget which ones you've used and you'll use the same switch for two or more different things.  That is a nightmare to debug!

Noted. How do you mark this as solved?
you report the first post and ask for it to be closed.  The mods will take care of the rest.
Thank you for helpful answer, I love seeing you on these -- how would I make it so that when you DO return, the effect is still there, but just at that map?
Yes. So you should find when you activate that event, you will not be able to activate it again, even if you leave the map and return. That controls the BGM only - there's nothing in that event that controls any NPC.


I would question why you have an event with no graphic set to Action Button? How is the player going to know there is something there to interact with and that they have to press space right on that spot?


Also, as I said, please use Alt+Printscreen to take screenshots. We specifically only want to see the event window, not your entire desktop, as it makes the stuff we're interested in too small to read what's going on.

@EmmaWatson, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



It's not really clear to me whether you are using XP as the OP of this thread was or MV. 'Erase Event' is likely what you're looking for. If that doesn't help, please make a new thread 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-end-events-when-leaving-a-map.70468/