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.
<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.
- 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.
- For aesthetics, I define a balloon on the event when it activates in "chasing" mode.
- The same goes for the sound effect.
- 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.
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.
As we saw earlier, the important options here are:
- Autonomous Movement:
Now set to "Approach."
- Priority:
The same as the previous page.
- 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.
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:
- 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.
- 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.