MV Enemy approaching player with chrono engine?

So what I'm trying to accomplish is essentially a very surface level AI for my enemies using chrono engine. I just want them to be able to detect when the player is occupying a tile beside them before executing their next action as opposed to approaching the player by a random amount and then acting, possibly tiles away from the player.

What I first tried was Yanfly's move route core but I ran into multiple issues. You can enter script commands to either move to X and Y variables, or you can just direct the event directly towards the player. The first issue I ran into was "gettargetelevation" error popping up upon boot up, I figured this was because I was using mv3d with tiles of varying height and move route core did not have a method to compensate for height. So I tried again with and entirely flat map still using mv3d but I then hit 2 more problems... the first is that the game slows SIGNIFIGNATLY upon spawning an enemy using this method of movement, and the second is that the event in question is trying to move to the actual space the player is occupying as opposed to a space BESIDE the player which of course it can never accomplish so the next action just never happens. All these things apply to both methods of setting the movement route, using an X and Y variable to track the player and then directing the enemy towards those variables AND directing it directly to the player.

So... after that I looked around a bit to try and find alternative solutions and I was able to find one that seemed somewhat promising: https://www.rpgmakerweb.com/blog/making-interesting-npc-move-routes-with-script-calls
using the "one event following another" I used the script call stated to have the enemy move to the variables I had tracking the players coordinates and again... I just get an error upon boot up.

So I'm reaching out hoping someone else out there may have another idea to solve this problem, I suppose keeping in mind that this project also uses mv3d also seems important as it introduces the whole height element that seems to cause some issues. Thanks in advance.
This thread has nothing to do with Chrono Engine? You're just asking how to make an event move to the player.

Galv Move Route Extras has commands for it if Yanfly Move Route Core doesn't work.

Chrono Engine does not change how events move (Cross Engine will because it uses Altimit but you said you're not using it). It seems like your issue is with MV3D/MZ3D
This thread has nothing to do with Chrono Engine? You're just asking how to make an event move to the player.

Galv Move Route Extras has commands for it if Yanfly Move Route Core doesn't work.

Chrono Engine does not change how events move (Cross Engine will because it uses Altimit but you said you're not using it). It seems like your issue is with MV3D/MZ3D
I moreso mentioned the involvement of chrono engine i suppose to clarify that this processing needed to take place in the movement route itself due to how it works as opposed to being able to use conditional branches which would make this alot easier. I'll check out Galv's move route extras
You can use conditional branches in Chrono Engine. I don't know why you think you can't.
You can use conditional branches in Chrono Engine. I don't know why you think you can't.
Within a custom movement route? I didn't think this was possible even with no plugins?
Yes, you can use conditionals within a custom move route. You just have to do it in a script call or you use the Japanese plugin FTKR_AddRoutineMoveCommands

This still has nothing to do with Chrono Engine

Yes, you can use conditionals within a custom move route. You just have to do it in a script call or you use the Japanese plugin FTKR_AddRoutineMoveCommands

This still has nothing to do with Chrono Engine

I supposed it was information that couldn't hurt. I've gotten crap for not providing enough details before in the past.
Unfortunately it can also have the opposite effect where if you say you have an issue with Chrono Engine only people familiar with it will click the thread
Unfortunately it can also have the opposite effect where if you say you have an issue with Chrono Engine only people familiar with it will click the thread
That makes sense, it seemed like relevant information at the time but I could've broken it down to a more basic overview of the problem. I apologize for the confusion
Yes, you can use conditionals within a custom move route. You just have to do it in a script call or you use the Japanese plugin FTKR_AddRoutineMoveCommands

This still has nothing to do with Chrono Engine

If you don't mind me asking how exactly would you write out a conditional branch as a script? I've tried looking around and can't seem to find a clear working answer.

For instance if I were to use: http://www.yanfly.moe/wiki/Event_Encounter_Aid_(YEP)

and wanted to run a script in the movement route to check using the this.checkEventFacingPlayerFront() command they have listed with a conditional branch could I do that?
The entire conditional statement would have to be a script
Code:
if(this.checkEventFacingPlayerFront()){this.step_toward(0);}
Using the this.step_toward(0); script from Galv Move Route Extras. You would use the script call for whatever movement you're using.

If you don't want to use scripts then use the FTKR plugin I linked.
The entire conditional statement would have to be a script
Code:
if(this.checkEventFacingPlayerFront()){this.step_toward(0);}
Using the this.step_toward(0); script from Galv Move Route Extras. You would use the script call for whatever movement you're using.

If you don't want to use scripts then use the FTKR plugin I linked.
I'd like to try and learn more how to write the basic scripts because I feel they add the most flexibility to your project but atm I know very little lol.

if(this.checkEventFacingPlayerFront()){this.step_toward(0);} throws me an error upon booting up
but this.step_toward(0); using Galv's move route extras works fine... is there some sort of formatting error? What's the basic idea of how these commands are strung together? Do you just start conditional branches with "if", put your condition in brackets (), and then the result in {} these brackets?

What if you wanted to run a string of checking multiple conditions in a script call? or how would you format an else condition?
What's the basic idea of how these commands are strung together? Do you just start conditional branches with "if", put your condition in brackets (), and then the result in {} these brackets?
Yes, that's basic javascript syntax for conditional statements.
What if you wanted to run a string of checking multiple conditions in a script call? or how would you format an else condition?

if(x && y && z){do something}
if(x || y){do something}
if(x){do something}else{do other thing}

&& being "and"
|| being "or"

Original thread: https://forums.rpgmakerweb.com/threads/enemy-approaching-player-with-chrono-engine.177833/