Event Page Won't Switch Off

Okay, so I set up a system where a guard is patrolling an area, and if the player enters his line of sight, he chases the player down and talks to him/battles with him or whatever (I just have placeholder text there for now). 

All that I want to happen is that after the guard chases the player down and interacts with him, the guard returns to patrolling the area. It works perfectly, except I can't get that patrol event to activate after the guard interacts with the player. 

All my event pages are below. The first is sets up the movement pattern for the guard, the second has the guard chase down the player, and the third has the guard interact with the player. Theoretically, the third should also switch off the second event and itself, so the only event left able to run is the first, the movement pattern one. Obviously, this isn't happening, the second event will stay on half the time, even though it's set to switch off before the text even pops up. Somehow, the text pops up and the second event is still not switched off, so my guard can't return to patrolling.

Also, I included the event that controls the guards line of sight just in case it helps. Please note that even when I'm standing well outside of the guards line of sight, the second event page (the one that tells him what to do when he spots me) is still active.

Thanks so much for the help, I feel like this should be simple but nothing seems to be working.

!!! I've added the other halves of Guard Movement 1 and 2. The bottom of Guard Movement 2 is where I switch "Guard Talking" ON, after the loop breaks. And thanks GrandmaDeb, you're tutorial compilations have been super helpful to me btw=)

Oh and sorry about on the third page Andar, normally that's been on Autorun or Parallel Process, I had to remake it real quick for the screenshot (I deleted the page when I was troubleshooting before I came to the forums). So just assume that it's an Auto or Parallel.

Update: Okay GrandmaDeb, so I tried what you said and somehow the "Player Spotted" switch is still getting turned on. I'll definitely keep that 1/2 second wait in mind for later, though, that's a good idea. And the "Left of Player" and all are variables I created with a bit of script. They just hold the X and Y position for 1 tile left of, right of, above, and below the player, so when the guard's X or Y is within that 1 tile proximity, he stops looping "Move toward player." Any other suggestions?

Final Update; I figured it out! I had to do a bunch of weird stuff including creating another event and making it so that the "Guard Sight" event would only activate under certain conditions, but it's all good now. Thanks for all the help!

Guard Movement 1.PNG

Guard Movement 2.PNG

Guard Movement 3.PNG

Guard Sight.PNG

Guard Movement 1 Bottom.PNG

Guard Movement 2 Bottom.PNG
When do you turn


"player spotted" off? Oh I see in the third page.


kk give me a minute then...


Where do you constantly reset the values of variables 3 and 4? (in the guard sight event)


Is that working? Oh crud I forgot you can do this directly now in Ace, sorry; we couldn't do that in VX. lol


You are probably going to have to post screenies of the lower half of those event pages.


I can't see where you set "Guard talking" to true.


FWIW it looks like a nice little system. =]
How does the player know that he has to hit the action button on the (invisible, no sprite) event to trigger the commands on the third page?
Okay, try this😛ut the switch that resets "Guard talking" in front of the test message that says "Gotcha"


I take it you do get the "Gotcha" message?


Sometimes old move routes mess things up.


A wait hanging around usually solves the problem. But your move routes are all over the place.


Personally I'd stick a Wait of half a second at the end of every event page on your Guard Movement event.


It sounds a bit haphazard, but I find that little glitches in timing at the end of events cause problems.


But the text of the gotcha message should do the same thing. So try moving the switch set.


Are "left of player" and all set automatically somewhere? I'm quite rusty. (/me opens ace)

Original thread: https://forums.rpgmakerweb.com/threads/event-page-wont-switch-off.43211/