Disable Escaping?

There's a specific area (at the end of the game) where I don't want the player to be allowed to escape at all. The encounters must be random, and the thing is I don't want the enemy to be able to move first. So I'd like to know if there is a way to disable it at this point in the game.
I will do whatever is necessary, I already have Yanfly Battle Engine Core if that helps (or hurts and you need to know) too.
Also, if it helps, I technically only need to disable it, not re-enable it. This is because you can't leave the area when you enter it and the area past it is the end of the game, which you can't escape anyway.
The enemies here are also unique to the area if this would help with anything.
bump, still hard on the search for an answer
Most probably this will require a custom plugin, but there is something you might try first.

From your post I assumed that you already know that the escape rate is agility - based.
However, the turn order is not entirely AGI-based, which means there is a way to give the enemy a high agility without them going first.
The turn order is based on agi PLUS skill-speed, and skill speed might be negative.

So try it with enemies that have a high agility but specific skills with a high negative skill speed.

Unfortunately that will not completely disable escaping, only make it much less likely to succeed.
Most probably this will require a custom plugin, but there is something you might try first.

From your post I assumed that you already know that the escape rate is agility - based.
However, the turn order is not entirely AGI-based, which means there is a way to give the enemy a high agility without them going first.
The turn order is based on agi PLUS skill-speed, and skill speed might be negative.

So try it with enemies that have a high agility but specific skills with a high negative skill speed.

Unfortunately that will not completely disable escaping, only make it much less likely to succeed.
Thank you very much! I already had all these enemies using unique skills, but I was unaware that the skill speed could be negative, (though I guess I could have assumed since most things can be in this), and I just put the AGI of the enemy to absolute max, and the AGI of the team is only 250. Thank you for the suggestion, everything is working great now! Having a SMALL chance should be fine, I just don't want it to be encounters that they can easily get rid of.
Just keep in mind that the chance to escape also increases with every failed attempt.
Even with such agility difference they will be able to escape after half a dozen attempts or so.
EDIT: Not sure about this after continued research. In the meantime, check my approach for VXAce users.
There's no way to do it decently without scripting. Luckily, it's very easy to do WITH scripting, given the fact that you said every encounter in this area is unique to that area. For each troop you want to be inescapable, add a Script call to its events and copy/paste the following:

BattleManager._canEscape = false;

Then, set that page to trigger on turn 0. The escape command should now be grayed out.

That said, do use this carefully. Inescapable random encounters can be super annoying, especially if the rate is high. That said, good luck!
Not to raise the dead, but...
When you use the Battle Processing event, there's a checkbox for "Can Escape."

1598750173950.png

Original thread: https://forums.rpgmakerweb.com/threads/disable-escaping.95449/