Hello, I've been trying to figure out a way to have an on map enemy chase me, I got it work however when I enable the pixel movement plugin that I have, it sadly complicates its pathfinding and ends up stuck in osbtacles and what not, what would be the best way to solve this? I tried looking for other plugins but I havent found anything, help is appreciated!
Pixel Movement For Chase
RPG Maker MZ SupportIt's rather hard for anyone to suggest another way to do this when you didn't tell us anything about how you're doing it now 😛
I mean, I'm using a pixel movement with this plugin: Altimit Movement and using the autonomous movement with this script:
$gameMap._events[this._eventId].moveStraight($gameMap._events[this._eventId].findDirectionTo( $gamePlayer.x,$gamePlayer.y ));
And that ends up with the enemy getting stuck in walls and not chasing as smoothly as the player.
There's not an easy answer to this because pathfinding is based on tiles and pixel movement breaks free of tile based movement. If you use one of the pathfinding plugins/scripts at best the event will move in 45 degree angles and it will lag the game. To have it move as smoothly as the player you will have to write your own navmesh-style pathfinding script, there are no plugins that I know of but if you find one let me know.
The script you posted is the engine's default A* pathfinding and only works in 4 directions so it doesn't even do diagonals.
You can try my Follow Player Path plugin which will make the event follow the player's exact path but it still occasionally gets caught on walls.
forums.rpgmakerweb.com
The script you posted is the engine's default A* pathfinding and only works in 4 directions so it doesn't even do diagonals.
You can try my Follow Player Path plugin which will make the event follow the player's exact path but it still occasionally gets caught on walls.
MV - Follow Player Path (Altimit Pixel Movement)
This plugin is for use with (Altimit) pixel movement. 4/6/24 v1.0 Latest release Everything is controlled in the plugin file and through plugin parameters now. No more setting up a parallel common event. Make an event follow the player's path exactly. This is useful for events and enemies that...
forums.rpgmakerweb.com
I'll give this a try and see! Thanks!
Sadly It doesn't but I opted to use the DotMoveSystem, the script I mentioned before and that gave better results, the enemy while it still uses tiles moves diagonally which allows for a smoother chase.
I'll be using this, thanks for the help!
Original thread: https://forums.rpgmakerweb.com/threads/pixel-movement-for-chase.172033/