Plugin that can allow for surprise attacks

I need a plugin or something similar that can allow for pre-emptive attacks when the player gets the enemy from behind, akin to the Romancing SaGa games, and for the inverse to be true. I'm using RPG Maker MZ for my game.
VisuStellas Encounter Effects has this function.

EDIT: Oh wait, it's not free. I'm still living in the old days, before yanfly.moe put up the paywall >.<
Might still be worth it, if you are willing to spend the money, since it has a lot of other useful functions too.
My big-box-of-stuff plugin, Cae_Tweaks, has 2 features that I think could achieve this:
  • M32 - event notetag <no lock> stops event from facing player when triggered.
    • You can check player and/or event direction with a Conditional Branch.
  • D12 - lets you force surprise/preemptive via plugin commands.

There are probably other options, e.g. Galv's Event Utility lets you check how an event was started, which might be more convenient in your case:
[EDIT] - Ops, sorry. Forgot to register the plugin commands. Download it again after this edit ^^''

Hi there!
I was just working on a plugin that includes a feature like that... So I manage to make a little plugin that let you control preemptive or surprise encounters.

1772726154242.png

1772726340999.png
[EDIT] - Ops, sorry. Forgot to register the plugin commands. Download it again after this edit ^^''

Hi there!
I was just working on a plugin that includes a feature like that... So I manage to make a little plugin that let you control preemptive or surprise encounters.

View attachment 362021
View attachment 362023
Thank you, also just one more thing. Is there a way to make events trigger other events, I want to have a monster chase you and then when it falls into a tile, it gets trapped and you can get a surprise attack on them. I saw the Visustella Plugin for something along the lines of enemies following you, but not for traps.
Thank you, also just one more thing. Is there a way to make events trigger other events, I want to have a monster chase you and then when it falls into a tile, it gets trapped and you can get a surprise attack on them. I saw the Visustella Plugin for something along the lines of enemies following you, but not for traps.
Make events trigger other events is really another thing.
But you said:

I want to have a monster chase you and then when it falls into a tile, it gets trapped and you can get a surprise attack on them
- That is not an event triggering another event. That would be the player triggering another event.

Perhaps what you is talking about is that by default your event is set to be activated by "Event Touch" and when the event is trapped, you want for the player be able to activate the event, like the trigger was set to "Player Touch"?

If that is the case, when the event is trapped, can you not flip a switch to change event page and change the trigger?
Make events trigger other events is really another thing.
But you said:


- That is not an event triggering another event. That would be the player triggering another event.

Perhaps what you is talking about is that by default your event is set to be activated by "Event Touch" and when the event is trapped, you want for the player be able to activate the event, like the trigger was set to "Player Touch"?

If that is the case, when the event is trapped, can you not flip a switch to change event page and change the trigger?
I tried having the event go over the trap but it did nothing, it was only when the played went over it did it do something
Is the trap in a fix location, or is the player able to set the trap anywhere on the map? If it's on a fixed location, you could use a parallel event to check if the monsters coordinates are matching this location and then turn a switch on.
If the trap has multiple possible locations, you'd have the event check if the coordinates of both events match, before turning the switch.
I tried having the event go over the trap but it did nothing, it was only when the played went over it did it do something
Oh, now I understood what you mean. Then you need to do something like @coucassi said.
An easy way to check for there is more than one event in a map coordinate is this:
$gameMap.eventsXy(10, 20).length >= 2
Replace 10 and 20 for x and y respectivelly.

But that will not check the event id. It can be any event id.

Another way would be:
$gameMap.event(ID1).pos(x, y)
Replacing X and Y for the location you want to check and DI1 for the event ID you want to check

That would work for you?
Is the trap in a fix location, or is the player able to set the trap anywhere on the map? If it's on a fixed location, you could use a parallel event to check if the monsters coordinates are matching this location and then turn a switch on.
If the trap has multiple possible locations, you'd have the event check if the coordinates of both events match, before turning the switch.
How exactly could I do that
I should have showed these before. Originally Had it be so that you called out to the monster and it would go after you and fall into the trap, but after not being able to do that, I decided to go with this solution

Oh, now I understood what you mean. Then you need to do something like @coucassi said.
An easy way to check for there is more than one event in a map coordinate is this:
$gameMap.eventsXy(10, 20).length >= 2
Replace 10 and 20 for x and y respectivelly.

But that will not check the event id. It can be any event id.

Another way would be:
$gameMap.event(ID1).pos(x, y)
Replacing X and Y for the location you want to check and DI1 for the event ID you want to check

That would work for you?
By the way I'm a huge beginner when it comes to this stuff. Sorry if I'm wasting your time, next time when I have more money, I'll just hire someone to handle this for me.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-that-can-allow-for-surprise-attacks.182744/