Help with Roguelike movement and Events?

I've seen a few threads on here about implementing roguelike movement in MV. (Specifically, events dont move if the player stands still. think Etrian Odyssey or Legend of Grimrock). So I installed mv3d, figured out how to put things in first person view, and then started working on on-map enemies

I'm having some difficulties dealing with making enemies move in routes or patrol. Currently, I'm using a parallel event has all this mess in it.
Spoiler: how my parallel event is set up
JavaScript:
◆Control Switches:#0001 hero moving = OFF
◆If:Button [Up] is pressed down
  ◆Control Switches:#0001 hero moving = ON
  ◆Set Movement Route:Player (Skip, Wait)
  :                  :◇1 Step Forward
  :                  :◇Switch OFF:0001
  ◆
:Else
  ◆Control Switches:#0001 hero moving = OFF
  ◆
:End
◆If:Button [Down] is pressed down
  ◆Control Switches:#0001 hero moving = ON
  ◆Set Movement Route:Player (Skip, Wait)
  :                  :◇1 Step Backward
  :                  :◇Switch OFF:0001
  ◆
:Else
  ◆Control Switches:#0001 hero moving = OFF
  ◆
:End

basically, it just means that when im moving it turns on a switch. (though it doesnt work if im strafing with the q and e keys but thats a plugin problem that ill need to tackle later).

in addition, enemy events have two pages to them, the first one is just the static enemy/idle sprite animation and the second page has "if control switch #0001 = ON" and a movement scheme to it. both just have the call battle function with the standard "if win delete this event" on it.

Spoiler: screenshots of my enemy events setup
1666922762390.png
1666922794708.png

so far so good. so long as I have the autonomous movement set to "go to player" or "random" it works fine, and I can use some yanfly plugins to designate tileset numbers as no-go-zones. Any single-line movement pattern seems to work. yanfly's movement options plugin has "hug right/left wall" as an option and that works fine.

now my issues are in making the enemies try to follow a pattern of movement that would require more than one line entry in the autonomous movement section. for example: patrol back and forth or go in a circle. normally, a standard custom route would solve this problem. however, any custom route I try to designate can only go through one, maybe two of it's commands before the switch turns off, the event reverts to the first event page and it stops moving. when the switch is activated again it essentially starts the commands from the top, meaning it cant get through the queued movement commands. I don't think theres an easy way to "save the spot" of the route. Im also aware that when turning the switch on, checking for a "button press" does not mean "did player move?" (and i think there's a script call to check for that?? im not sure how to use that. i should check basics of script calling).

so i guess my questions are this-
a) how do i set the "is the player moving?/has player moved?" check to make the control switch thing more elegant because i know theres a function for that and i just dont know how to use it
b) What are some ways to get the affected events to move in a route? i dont know how to allow the event to do something like "move right until you hit a wall, then turn on self switch A once you can't move" in the autonomous movement editor so i can do the opposite in a separate page.

Currently the only relevant plugins I have installed are mv3d, and some of the free Yanfly plugins namely Move Route Core, Extended Move Parameters, and Enemy Pursuit.

im also aware that Arisu wrote a "synchronized event movement" plugin that would solve all my problems with it's custom route functionality but that costs 8 bucks and i wanna see what i can do first

Thank you!

edit: i forgot to tag this as RMMV and i dont know how to edit the tags. im using MV version 1.6.2
edit edit: figured out how to tag lol
edit: i forgot to tag this as RMMV and i dont know how to edit the tags. im using MV version 1.6.2
It's not super necessary when you're posting in a maker-specific forum (MV Support). You can also set in your user profile that you use MV so that people can see it if you're posting in other threads.

a) how do i set the "is the player moving?/has player moved?" check
I would take a page from the common implementation of footstep sounds: at the start of the game, set two variables to the X and Y coordinates the player spawns at. Then have a parallel event that stores the player X and Y again in another pair of variables and compares those 2 to the old 2. If they're different, the player has moved.

Then store new into old and wait for 60 frames.

b) What are some ways to get the affected events to move in a route? i dont know how to allow the event to do something like "move right until you hit a wall, then turn on self switch A once you can't move" in the autonomous movement editor so i can do the opposite in a separate page.
I would take it out of routes and program it in your event. Some of this could be made more streamlined via script calls, but a lot of it can be done in event commands.

For example, you can draw Regions over sections of the map (or where walls are), then do:
Control Variables -> Game Data -> Character -> This Event -> Map X
Control Variable -> that above variable -> Add 1
Control Variables -> different variable -> Game Data -> Character -> This Event -> Map Y
Get Location Info -> Info type Region ID -> Designation with the above X and Y variables

That tells you the region ID of the tile to the right of the event (X + 1). Then you can use a Conditional Branch saying "if that region ID variable is 0, move right" - or whatever.
thanks a ton! these all help a lot!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-roguelike-movement-and-events.152285/