Monster events respawn when they shouldn't? Need help

So, I've looked hard but can't figure out why this is happening.

I map A (a town map) connected to map B (outside area), connected to map C (another outside area).

I put monster events on map B.  I want them to respawn if the player goes back to town, but NOT if he just continues to explore (map C).

The way I did this was: 

-on the first page of the event, after the battle processing, a self-switch is turned on.

-the 2nd page of the event has self-switch as its condition.

-the 2nd page also has a conditional branch:  "If (respawn switch) is ON, then turn off the self-switch"

-the player transfer event from Map B to Map A sets the respawn switch to ON (so that the monster events on Map B respawn)

-the player transfer event from Map A to Map B sets the respawn switch to OFF (and it obviously starts out the game off), so that when joining Map B, the monsters don't respawn until you go back to Map A.

-the player transfer event from Map B to Map C, and from Map C to Map B, do nothing with the switches, they only transfer the player.

What is happening in game:

When players kill monsters on Map B, they don't respawn - good.

When players go to Map A and then back to Map B, the monsters respawn - good.

When players go to Map C and then back to Map B, the monsters respawn?! BAD.

The respawn switch isn't set to be turned on or off from Map B to Map C or vice versa.  I've double checked everything, but wondering if anyone has any ideas of some mechanic I'm not aware of that's making this occur?  Thanks for taking the time to read all this.
Please post screenshots of your events. It might be something like wrong page priority or wrong logic settings, or it might be that one of your scripts set the switches without your knowledge.

Most probably it's the wrong switch sequence on page 2 - but we need to see that and your transfer events where the switches are controlled to find the cause.
Here's both pages of the monster event, and the transfer events from Map B to Map C and vice versa.

ToMapB.jpg

ToMapC.jpg

MonsterEventPage2.jpg

MonsterEventPage1.jpg
You mixed up a lot, and such events cannot function unless you have a script somewhere, and that script might cause the problem.

1) The first page of the monster event is conditioned to self-switch B, and that self-switch is only controlled on that same page.

Which means that this page will never be active and never initiate combat unless you have a script that enables self-switches for other events.

And such a script WILL cause problems in that logic, so get rid of that.

2) where is the respawn switch set? The transfer events should do that, but they don't contain any control switch command

And if you do not use that switch, of course the second page can never function

3) add a wait(30) to the second page of all monster events

Currently they're checking the switch sixty times per second while the player is on the map - the more defeated monster there are, the more lag that will cause. And you don't need to check that sixty times per second.
Whoops - that screenshot is wrong, that was taken after I was trying to mess with a second self-switch to try and fix this.  Here's how it looks.  Here's also the respawn switch which is set going from Map A to Map B, and vice versa. 

Ah ok, I'll do that re: 30 seconds wait.

MapAtoMapB.jpg

MapBtoMapA.jpg

MonsterEventPage1FIXED.jpg
1) Any command after a transfer to a different map can be omitted - sometimes they still work, sometimes they don't.

2) Events are only processed for the map the player is on, they do not exist for other maps.

Which means that the respawn switch has to be ON on the fighting map for at least a few frames for the sequence to work correctly (depends on where an when you set the wait on the parallel processes). Switching it ON and OFF only on map A will have no effect on map B, it needs to be on while the player is on map B.

I suggest setting it on before tranferring to map B, and switching it off by an autorun after a wait sequence on arrival on B - have the autorun erase itself after that.

and NO, wait(30) is NOT a 30 second wait, it's a 30 frame wait - or half of a second
Okay, I think I got it working.  Thank you. 

So it should be wait(999) which would be about 16 seconds, so put two of those?  and I assume I should put those BEFORE the conditional branch, as the first thing on the 2nd event page, so that it waits before checking the condition?
NO, it should be wait(30) as I said - and the best place should be in the else-branch of the conditional branch if that works.

Waiting before checking might interfere with the switch depending on when that is set on entering the map
Here is a quick example I put together...

Map B to Map A = Monsters Respawn

Map B to Map C = Monsters DONT respawn

Map C to Map B = Monsters DONT respawn

[IMG]http://i.imgur.com/4HNEg0Q.png[/IMG]

AndarAdvanced Member

Global Moderators

8,120 posts
Location Germany
Primarily Uses RMVX Ace
First Language German
Posted 24 May 2015 - 10:02 AM

NO, it should be wait(30) as I said - and the best place should be in the else-branch of the conditional branch if that works.
Waiting before checking might interfere with the switch depending on when that is set on entering the map
I used it before the Conditional branch so that it does not lag the game by constantly doing the Conditional branch.

Mine checks (Every 1/2 Sec) check if yes (Then Respawn)

yours is (Cond) then (Wait) making it run 2 commands = more lag

I dont know... but thats what I usually do with waiting and conditional branches...
I totally just revived this thread on accident... thought all this was today >.<

Original thread: https://forums.rpgmakerweb.com/threads/monster-events-respawn-when-they-shouldnt-need-help.40308/