Can anyone tell me when these occur? I mean, how they are calculated and whether or not there's a difference between random encounters and battle processing events? That would be nice. 🙂 Thank you!
Pre-emptive/Surprise Attacks?
RPG Maker MV SupportThis is based on ACE's flow, but I imagine MV's is not much different.
In ACE, first the system decides if there is to be a fight or not. If it decides to have a fight, it calls the command on_encounter (under the Battlemanager), and at the end of that function it rolls for preemptive or surprise attacks.
The default Preemptive rate is 3% if your AGL is below the enemy, and 5% if your AGL is above the enemy. Surprise is 5% chance for being surprised if your AGL is below the enemy, and 3% if your AGL is above the enemy.
Also, if you call the battle event directly (via an event) it skips the preemptive and surprise roll completely (so battles called via events cannot ever be a surprise or preemptive event). I've seen a plug-in to fix it somewhere, but can't remember where.
Anyways, I'd start by looking at the Battlemanager file, and see what happens in the on_encounter command in MV. I imagine the commands called for rolling preemptive and surprise events are still there, as all MV code I've seen so far has everything in the exact same place as it was in ACE (at least so far). For evented battles, it was command_301 under Game_Interpreter that made it skip the rolls in ACE, so try there for MV.
In ACE, first the system decides if there is to be a fight or not. If it decides to have a fight, it calls the command on_encounter (under the Battlemanager), and at the end of that function it rolls for preemptive or surprise attacks.
The default Preemptive rate is 3% if your AGL is below the enemy, and 5% if your AGL is above the enemy. Surprise is 5% chance for being surprised if your AGL is below the enemy, and 3% if your AGL is above the enemy.
Also, if you call the battle event directly (via an event) it skips the preemptive and surprise roll completely (so battles called via events cannot ever be a surprise or preemptive event). I've seen a plug-in to fix it somewhere, but can't remember where.
Anyways, I'd start by looking at the Battlemanager file, and see what happens in the on_encounter command in MV. I imagine the commands called for rolling preemptive and surprise events are still there, as all MV code I've seen so far has everything in the exact same place as it was in ACE (at least so far). For evented battles, it was command_301 under Game_Interpreter that made it skip the rolls in ACE, so try there for MV.
Original thread: https://forums.rpgmakerweb.com/threads/pre-emptive-surprise-attacks.49837/