Extreme lag, when using YEP_X_MapQuestWindow with custom Timer

Sorry for my bad english, I got an extreme lag when using YEP_X_MapQuestWindow plugin with my custom timer (Only when I got a mission/quest that is currently progressing)

The FPS is restored when I either erase the timer or by turning off the plugin.
This is my custom timer code:

◆Control Switches:#0027 ChaseTimer Switch = ON
◆If:Script:Math.abs($gameMap.event(this._eventId).x - $gamePlayer.x) + Math.abs($gameMap.event(this._eventId).y - $gamePlayer.y) <= 1
◆Battle Processing:Siluman Air Biru*2
:If Win
◆Script:this.setSpawn(0,0,20);
◆Control Variables:#0023 Timer Chase Air Biru = 0
◆Control Switches:#0027 ChaseTimer Switch = OFF
◆Control Self Switch:B = ON
◆
:If Escape
◆Set Movement Route:This Event (Skip)
: :◇1 Step Backward
: :◇1 Step Backward
: :◇Wait:60 frames
◆Control Variables:#0023 Timer Chase Air Biru = 0
◆Control Switches:#0027 ChaseTimer Switch = OFF
◆Control Self Switch:A = OFF
◆
:End
◆
:Else
◆If:Timer Chase Air Biru = 3
◆Control Variables:#0023 Timer Chase Air Biru = 0
◆Control Switches:#0027 ChaseTimer Switch = OFF
◆Control Self Switch:A = OFF
◆
:End
◆
:End



And this is my common event:
1658221386585.png




Also this is my current plugin:
1658221462719.png

I've moved this thread to Plugin Support. Thank you.

Please post some actual screenshots of the event in the editor. The code is useful, but there are other settings in the event that will help debug your problem. You provided a screenshot for the related common event, but not the actual map event you reference.

Generally speaking, lag is from events running continuously (autorun or parallel) and trying to do a lot of stuff every frame.

It's a little hard to read your pasted event code without its indenting, but it looks like the entire thing is inside a conditional that's checking the player location (so I presume it is set to parallel). You should not have that running every frame, it's not possible for the player to move that quickly. Stick a Wait: 60 command at the bottom and see what happens.
Please post some actual screenshots of the event in the editor. The code is useful, but there are other settings in the event that will help debug your problem. You provided a screenshot for the related common event, but not the actual map event you reference.

Generally speaking, lag is from events running continuously (autorun or parallel) and trying to do a lot of stuff every frame.

It's a little hard to read your pasted event code without its indenting, but it looks like the entire thing is inside a conditional that's checking the player location (so I presume it is set to parallel). You should not have that running every frame, it's not possible for the player to move that quickly. Stick a Wait: 60 command at the bottom and see what happens.
Yes, you're very right, it was actually a custom pathfinding method that I tried.., the enemy will chase the player if they stepped on an certain area detection.
Alright, I will try to check some of the events again and put some wait frame and see what happen, thank you for your reply OwO)/
you plugin order of YEP (yanfly) are also not on the correct spot.
they MUST be in the same order as on his website.

(or use the plugin in my spoiler) which is a modified version for
the entire list of his library to see which one is out of place and
correct them as given.

strange things can happen if they are on the wrong spot.
you plugin order of YEP (yanfly) are also not on the correct spot.
they MUST be in the same order as on his website.

(or use the plugin in my spoiler) which is a modified version for
the entire list of his library to see which one is out of place and
correct them as given.

strange things can happen if they are on the wrong spot.
Hooo okay, I will definitely noted that, thank you for the suggestion, I will try it now OwO
Thank you for all the supports, the problem has been resolved now, special thanks to ATT_Turan and ShadowDragon, the wait frame and also the YEP plugins order really does matter to solve this, thank you very very much! It made me cry a little bit since I've been trying to solve this for a few days QwQ) really, thank you
good to hear, good luck on your project further 🙂

Original thread: https://forums.rpgmakerweb.com/threads/extreme-lag-when-using-yep_x_mapquestwindow-with-custom-timer.149616/