Overworld Enemies/Chasing in range

I'm pretty new to RPGMAKER MZ but ive researched this topic a lot and im at a loss here.

So how i have enemies set up right now is that their movement route is set to 'approach', and once touched they start a battle.

How id like to have it is that once the enemy 'sees' you (or you enter a certain range) they chase you down for a certain amount of time or until you exit that range. Think Earthbound or the first two Paper Mario games.

Most of the solutions for this seem to be for MV, or to use MV-Specific plugins which i dont have access to. Im not super familliar with javascript yet so I wouldn't be sure how to script something like that- Does anyone have any solutions or options for me?
Not totally sure how it works, as I haven’t used it yet, but visustella has a plug in that effects the enemy approach ai.
There is indeed the Encounter Effects plugin by VisuStella for creating this dynamic. However, you can also use another plugin that might be suitable for you, the Events and Movement Core by VisuStella. Below, I outline the differences between the two plugins.

Encounter Effects by VisuStella:

  • This plugin is specifically designed to recreate this dynamic, so visual effects, chasing, returning to the starting point, and giving up the chase are all managed by it.
  • This plugin needs to be purchased (more details on the reference site).
Events and Movement Core by VisuStella:

  • This plugin actually does many things; among them, it can recreate the dynamic you're looking for but with some limitations. We can define a range within which the event will chase the player and also a timer after which the event will give up the chase. Staying within the tool commands without complicating things with scripts and JavaScript code, we cannot define a true "line of sight" but only a range.
  • This plugin is part of VisuStella's core plugins; is free but the developer accepts your support by letting you pay what you think is fair for the game. (more details on the reference site).
Below, I will explain the procedure using the second plugin I mentioned (Events and Movement Core by VisuStella).

What we need:

  • A parallel event that checks if the enemy is activated and, if so, deactivates it after a certain time.
  • An enemy event that chases us.
Let's start by exploring how the plugin can help us.


1726216041751.png



<Activation Square: x>

Here, this is what we need. Now we need to think about our enemy; we need 2 states for it: chasing and patrolling. Let's start by defining our enemy.

1726216326511.png


  1. The comment takes the code tag. For this explanation, I've chosen a range of 5 tiles of distance between the player and the event.
  2. For aesthetics, I define a balloon on the event when it activates in "chasing" mode.
  3. The same goes for the sound effect.
  4. I activate a switch that will switch to the second page of the event, where we have our chasing movement.
On this page, it's important to pay attention to the behaviors that define its actions. Let's examine them in detail.

1726216607466.png


1) Autonomous Movement:
Here we define the "patrolling" movement, which is a random movement.

2) Priority:
Here, the event must be on the same plane as the player, so "Same as characters" is the option we are interested in.

3) Trigger:
Here, thanks to our plugin tag, we define the trigger that will allow us to "see" the player. We have set it to "event touch," which normally means the event must be adjacent to the player. Thanks to the plugin, we extend the event’s range up to 5 tiles, so it’s as if our event is adjacent to the player whenever it is within a distance of 5 (or fewer) tiles.

Once this is defined, we need to set the behavior of the event while it is in the chasing phase. To do this, we move to the second page of the event. I remind you that this page is activated by the "Trigger chase 2" switch. Let's see what this page contains.

1726219181906.png




As we saw earlier, the important options here are:

  1. Autonomous Movement:
    Now set to "Approach."
  2. Priority:
    The same as the previous page.
  3. Trigger:
    The same as the previous page, but there is an important difference here. We don’t have the plugin tag on this page (<Activation Square: x>), so the event touch returns to the default behavior. The battle will start when the event is actually adjacent to the player and can "touch" it.
Now, let’s move on to the final phase of our dynamic. After a certain period of time, we need to make our chaser give up. To do this, we need a parallel event that checks if the event is active and, if so, activates a shutdown timer.

1726219480611.png


This parallel event (note that you can also use a common event for this) checks if the switch "Trigger chase 2" is On. If it is, it waits for 3 seconds (180 frames) and then turns it Off. As mentioned earlier, sound effects and balloons are used to create the scene and provide the player with visual and auditory feedback about the enemy's behavior.

Be aware of issues:

  1. Followers:If you use the "Show player followers" option, the event might get blocked by your ally at the rear and not trigger the battle.
  2. Event Page 1:Everything you place on the first page of the event will activate when the player is at the distance defined by the plugin tag. Therefore, the first page should never contain commands to start battles or other actions that should not trigger within a range greater than 1 tile.

In conclusion, I believe the best alternative remains the Encounter Effects plugin by VisuStella. However, if you want to experiment and save some money, the Events and Movement Core is a modest alternative.

That’s all. If you have any questions or issues, I’ll be happy to answer and resolve them.
This plugin is part of VisuStella's core plugins; it requires a voluntary contribution
Where do you see that? The entire VisuStella core project is free to download. (also, "require" and "voluntary" don't seem to make much sense 😛 )
Hey i wanna say youre solution ended up working for me! thank you for the help!
Where do you see that? The entire VisuStella core project is free to download. (also, "require" and "voluntary" don't seem to make much sense 😛 )
That user has such an oddly formal way of posting everything like a technical manual that I suspect might be a bot.
That user has such an oddly formal way of posting everything like a technical manual that I suspect might be a bot.
Oh the posts are absolutely AI. I'm giving them the benefit of the doubt, and presuming that they're using AI to translate because their English skills are poor - but a lot of the prose reads "fake" and often contains bits of incorrect information.

And it's hard to tell whether the incorrect information is coming from the person or added in the translation by AI.
Oh the posts are absolutely AI. I'm giving them the benefit of the doubt, and presuming that they're using AI to translate because their English skills are poor - but a lot of the prose reads "fake" and often contains bits of incorrect information.

And it's hard to tell whether the incorrect information is coming from the person or added in the translation by AI.
This is my first post here so I just assumed the final boss of rpgmaker forums responded lol
A bot? I wish I were . Sorry for my English, it’s not my first language, but I’m trying to learn quickly.

It’s true, I use AI and other translation sites to help me with translations. Does that go against the forum’s rules?

In any case, I’ll be happy to prove I’m not a bot by answering any question or taking any test you’d like to give me. Just not here, I think we’re all going off-topic by discussing it here. The section of my profile is open to any questions you may want to ask to clear your doubts .

Let me know if you need any further adjustments!
It’s true, I use AI and other translation sites to help me with translations. Does that go against the forum’s rules?
Not technically - but you should be careful to make sure it's only translating things you know and are saying in your native language, and not making up information. Posting answers generated by AI is against the rules.

In any case, I’ll be happy to prove I’m not a bot by answering any question or taking any test you’d like to give me.
I don't see what that's supposed to prove. What are we going to ask, your favorite color? Anyone can answer anything to that. No one cares to try to test you, just if you need to use AI for your translations, make sure you're controlling what it says.

There's no point in answering people's questions if the answers aren't right.

Original thread: https://forums.rpgmakerweb.com/threads/overworld-enemies-chasing-in-range.171836/