Making NPC's move while off-screen

I have been trying to figure out yesterday on how can I make the NPC's go in the player's direction while off-screen (As part of a large maze sequence for my game where the said NPC would stalk/go in direction of the player while they would attempt to get out), altough I have not been able to find a way to do this.
Is there any way or plugin to make this work
Well, if off-screen, cant you just warp them closer (but still offscreen > then the "move closer" command)? Its a cheap trick but wouldnt this work?
the reason for this is an anti-lag feature:
all autonomous movement stops for events outside a certain range/the screen.

you can bypass this by using set move route instead, but should keep in mind that there is a reason for the anti-lag features: too many parallels on a map will cause problems for the engine.

so be careful when experimenting
This is easily done. Put this in a .js file and add it as a plugin:
JavaScript:
Game_Event.prototype.isNearTheScreen = function() {
	if(Game_Character.prototype.isNearTheScreen.call(this)) return true;
	if(this.event().meta && this.event().meta.distantUpdate) return true;
	if(this.page() && this.page().meta && this.page().meta.distantUpdate) return true;
	return false;
};

Now you can add <distantUpdate> to the event note box, and the NPC will move even while offscreen. If you have my SFG_Utils installed, it'll also work if you put <distantUpdate> in a comment on any page – in that case, it'll only move while offscreen when that page is active.

But keep in mind the cautions noted above – generally, you don't want to do this for all your events, just a select few.

For example, I used it only on a single event: a character that runs around the entire town, but they're in an inaccessible place, so the only way to talk to them is to wait in one location and get in their way as they come around. If they didn't update while offscreen, you'd be waiting forever, unless you got lucky.
Is there any way to make them able to move at greater range?
Since as far as I tested they are only able to move if player is in 25/26 tile radius from them
Literally the post right above yours does exactly that (unlimited range).

It could be adapted to have a limited but increased range, if you wanted.

I believe the actual default range is roughly "a screen and a half away" - it really is based on screen size, so if you make your window bigger so it shows more tiles, the range increases to match.
By the post above mine, you mean your post, the one with the code?
Since I did use that, and it only worked in the said 25/26 tile radius
(At least when I tested it out in a 50 tile wide test map, with the npc with those parameters)
Zrzut ekranu 2026-04-24 173725.png
Then you have some other plugin messing up that part of your project's engine.

Because both my solution of using set move route and that mini-plugin should work everywhere even on the largest maps.

Please post both screenshots of your plugin manager and show an example of your move routes (preferably in the variant with a set move route command instead of autonomous movement
The code I posted definitely works for more than a 25 tile range – in my project, the map is 44 tiles high and the event continues to move along the top edge of the map even when the player is right at the bottom edge.
@Mandelic_Mark Yanfly's Move Route Core has a function you can attach to certain events with <Always Update Movement> in the notetag window in an event page so they can move even when off-screen.

Move Route Core is part of his free starter pack essentials, so you don't need any money to pull this off.
Okay, so I realised that the issue was that the Approach in Autonomous Movement,
Custom Movement works just fine and I realised that just using the "Move towards the player" does the trick
So yeah My bad for the confusion, and thank you everyone for help
the issue was that the Approach in Autonomous Movement,
which is what I told you in post #3 above

Original thread: https://forums.rpgmakerweb.com/threads/making-npcs-move-while-off-screen.183348/