Move after player?

Hello! I'm new to these forums ^^
The truth is i've been struggling with this for a good time now... I started a roguelike proyect on my RMMV and i made it to generate random maps with monsters and items. What i want now, is to make the monsters move every time my character does.
I don't want them to chase me if i'm still, i want them to chase me every step i take, making some kind of turn-based map movement. (More like Pokemon Mistery Dungeon or Pixel Dungeon system) My problem is that i don't find any "If player is moving" or "Move after player" conditional, so i don't know what to do 🙁
So far i tried playing with Yanfly's input and stop movement plugins but i couldn't manage to find a way to do what i want x.x
So if any of you guys knows a way, even if its with a build mechanic or a plugin, i don't care, please let me know, i'd be reaaally grateful!

Here's a video of Pixel Dungeon's movement system so you can catch what i'm talking about:
I feel like a dummy suggesting this, but did you know about "approach"?

Screen Shot 2017-02-13 at 11.20.55 PM.png

dogchase.gif

One might possibly hybrid some conditions with it, to make it smoother, but I can't write any better than default.
Yeah that's what i'm using right now, but if i stand still they keep approaching me, i want them to move only when i do, like a turn based movement system. If i could find a way to trigger the approach behavior only when i'm moving, then my problem would be solved, but no idea Dx
Thanks for the answer tho!
PHP:
if($gamePlayer.moveByInputOld === undefined){
 $gamePlayer.moveByInputOld = $gamePlayer.moveByInput;
 $gamePlayer.moveByInput = function(){
  var move = $gamePlayer.isMoving() ? 2 : 0;
  for(var i = 0; i < $gameMap._events.length; i++){
    if($gameMap._events[i] === undefined)
      continue;
    if($gameMap._events[i]._moveType !== move)
      $gameMap._events[i]._moveType = move;
 }
 return $gamePlayer.moveByInputOld.apply(this, arguments);
 } } // < last line so an extra end for you

Try calling something like this by event script. The is move = 2 is the approach for when moving. The 0 is a stop for when stopped, but it can also be 1 for random or something.

(this script is the max height of lines for event script. If you're going to add stuff, you'll have to minify it. I learned that by making an eval error when my end of input got clipped.
Oh my god! That's actually really cool! I have almost 0 skill at scripting, i couldn't have done something like that xD
My only problem is that now even the chests move lmao I see that you wrote "events" and that must affect all of them.
Im currently calling the script with a paralel event, what if i tried calling it directly from each monster but replace the "events" word with "this event"? Is there even a tag for that? xD
Thank you very much!

EDIT: So far i tried this but it says "a" is not defined. ("a" is how i named the monster events) I'm so sorry i butchered your code but as i said i have no knowledge :,)


if($gamePlayer.moveByInputOld === undefined){

$gamePlayer.moveByInputOld = $gamePlayer.moveByInput;

$gamePlayer.moveByInput = function(){

var move = $gamePlayer.isMoving() ? 2 : 0;

for(var i = 0; i < $gameMap._eventId(a).length; i++){

if($gameMap._eventId(a) === undefined)

continue;

if($gameMap._eventId(a)._moveType !== move)

$gameMap._eventId(a)._moveType = move;

}

return $gamePlayer.moveByInputOld.apply(this, arguments);

} } // <
Ok. If you refer to the _characterName which is the image file of the event without the ".png", you can make this event script effect only those certain characters.
PHP:
if($gamePlayer.moveByInputOld === undefined){
 $gamePlayer.moveByInputOld = $gamePlayer.moveByInput;
 $gamePlayer.moveByInput = function(){
  var move = $gamePlayer.isMoving() ? 2 : 0;
  for(var i = 0; i < $gameMap._events.length; i++){
    if($gameMap._events[i] === undefined || $gameMap._events[i]._characterName.match(/Nature|Monster/) === null) // only Monster.png and Nature.png
      continue;
    if($gameMap._events[i]._moveType !== move)
      $gameMap._events[i]._moveType = move;
 }
 return $gamePlayer.moveByInputOld.apply(this, arguments);
 } }

That will match all events with Nature.png or Monster.png and you can add |Other|Other2|Etc if you need more or less.

If your chest is on the same charset as the monsters, then I may need to figure out how to refer to event names instead of character names.
You're a genious. Now i can add all the monster sprites i want and add them to the script 😀
Thank you very much <3 I will add you to my project credits if i ever finish it :,)
This thread can be closed now i guess, this is exactly what i needed c:

Original thread: https://forums.rpgmakerweb.com/threads/move-after-player.74877/