Enemy Agression plugin/method?

MegaGothmog

Villager
Member
Joined
Mar 29, 2022
Messages
6
Reaction score
2
First Language
Dutch
Primarily Uses
RMMZ
Hey there.
I'm relatively new to PRGMaker MZ and I'm trying to get enemies to turn agressive and home-in on the player when you get closer to them.. or when they see you.
I do not mean an 'aggro in-battle' and having the enemy target the one character rather than the other.. I mean having NPCs on the map approach you when you get close to them.

I have tried to set the Autonomous movement of a character to Approach, but this makes them move towards me, no matter where I am on the map.
Is there a way to limit this to either their view, or a specific area around the NPC ?
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,224
First Language
English
Primarily Uses
RMMV
I use GALV_EventDetectors.js for what you described, but ofc, I use MV. I'm sure there is an MZ equivalent to that plugin though.
 

woootbm

Super Sand Legend
Veteran
Joined
Apr 26, 2014
Messages
303
Reaction score
229
First Language
English
Primarily Uses
RMMV
Something I did in MV (and I expect these features should still exist in MZ) is place events with switches around an enemy that patrols around. The switch changes their event page to one that has a chase movement route:
1656446911562.png
Those script events will play an animation and then move the event back to its original location (these commands might be different in MZ). Then the switches turn off the aggro switch I made. I have an additional switch because my first event page has an aggro animation that plays so that the enemy alerts the player that they've started to chase (like Metal Gear or something).

Just add or remove more "move toward player" commands to influence how long they will chase the player.

Of course, you don't have to do the ending bit if you just want the enemy to endlessly chase the player. You'll also want to turn these switches off when you transfer zones otherwise the enemies will immediately chase the player when you re-enter the zone.
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,224
First Language
English
Primarily Uses
RMMV
This addon is exactly what you want: http://www.yanfly.moe/wiki/Event_Chase_Player_(YEP)
Not sure if it works with fossil for MZ though.
Ah, I've tried that one before as well. I don't quite remember why I switched from YEP_Even_Chase_Player to GALV_EventDetectors, but it had to do with being able to set multiple behaviors or conditional behaviors or something along those lines.

But in any case, this might be the MZ version of those plugins:
 

MegaGothmog

Villager
Member
Joined
Mar 29, 2022
Messages
6
Reaction score
2
First Language
Dutch
Primarily Uses
RMMZ
Ah, I've tried that one before as well. I don't quite remember why I switched from YEP_Even_Chase_Player to GALV_EventDetectors, but it had to do with being able to set multiple behaviors or conditional behaviors or something along those lines.

But in any case, this might be the MZ version of those plugins:
I was going throught he VisuStella library trying to find a plugin that was like this... but i must've missed it. Thanks for the suggestion.. this one seems to fit my needs quite well.
 

Latest Threads

Latest Profile Posts

Im free today . finally have some time to continue coding . yes!
Regret that I wasn't able to actually finish my igmc entry in time for the actual igmc. Will probably just offload it as a standalone thing.
I'm a master in procrastination and have finally decided to educate people in this art in a seminar in Calais. Please don't come. I won't be there.
Testing some of my custom battlers (they're all trash, sorry).

Forum statistics

Threads
124,425
Messages
1,163,489
Members
163,229
Latest member
kuylar
Top