Hi I recently started developing with rpg maker MZ and have little experience with the engine, I was looking for a way to make an event that represents an enemy to detect the player when the player is within a certain range of it, to then start chasing the player, and once the event touches the player to initiate a battle, and if the battle is won the event is made stationary and can be interacted with the action button. kind of like fear and hunger, or almost exactly like fear and hunger lol. Ive done some digging and found that F&H used a plugin for MV, but I would prefer to stick to MZ. I already found a script that lets an event chase the player and it works how I want it to. I just cant figure out the detection and starting the battle, because currently I have it so that the event begins chasing the player when the player steps within a region (in this case 1), but when the player leaves the region the event stops chasing until player re-enters the region, its not bad but not perfect, and either way I can't figure out how to make it to were when the event touches the player the battle starts because I have to set the event trigger to parallel instead of event touch inorder for the event to move when the player steps within its assign region. any help would be appericated!
the code i used:
$gameMap._events[this._eventId].moveStraight($gameMap._events[this._eventId].findDirectionTo( $gamePlayer.x,$gamePlayer.y ));
and the video I got it from:
Ive attached images of the content of the event and the region map
the code i used:
$gameMap._events[this._eventId].moveStraight($gameMap._events[this._eventId].findDirectionTo( $gamePlayer.x,$gamePlayer.y ));
and the video I got it from:
Ive attached images of the content of the event and the region map