way to enable/disable fleeing mid battle

I have a battle where a corpse pile with hands appears and you need to defeat all the hands before you can escape, thus fleeing should be greyed out at the start of battle and only selectable once all the hands are down. the hands can respawn after a few turns and disable the option to flee again. is there a way to do it without using scripts? I know _canescape is an rpgmaker mv feature not vxace and I can't find any existing scripts online.
Hello,

Assuming you don't have any other script changing the rules of escaping, you can put this small script above main:
Ruby:
module BattleManager
  #b is true or false
  def self.can_escape=(b)
    @can_escape = b
  end
end #BattleManager

And use script command during battle:
BattleManager.can_escape = true
Or
BattleManager.can_escape = false
To enable or disable the escape command during the batte. Note that each new battle will reset this value to the battle setting (so true for encounters and scripted battle with escape allowed) and false for scripted battles with no escape.
You'd have to use a script call condition like the following (replacing INDEX with the actual position):

Ruby:
$game_troop.alive_members.size > 1

...and add what Timtrack mentioned above inside that conditional block to block the runaway feature. Of course, that line doesn't ask the engine if the only survivor is the main enemy.
Hello,

Assuming you don't have any other script changing the rules of escaping, you can put this small script above main:
Ruby:
module BattleManager
  #b is true or false
  def self.can_escape=(b)
    @can_escape = b
  end
end #BattleManager

And use script command during battle:
BattleManager.can_escape = true
Or
BattleManager.can_escape = false
To enable or disable the escape command during the batte. Note that each new battle will reset this value to the battle setting (so true for encounters and scripted battle with escape allowed) and false for scripted battles with no escape.
ill try this and report back
Hello,

Assuming you don't have any other script changing the rules of escaping, you can put this small script above main:
Ruby:
module BattleManager
  #b is true or false
  def self.can_escape=(b)
    @can_escape = b
  end
end #BattleManager

And use script command during battle:
BattleManager.can_escape = true
Or
BattleManager.can_escape = false
To enable or disable the escape command during the batte. Note that each new battle will reset this value to the battle setting (so true for encounters and scripted battle with escape allowed) and false for scripted battles with no escape.
tyvm it works!!!!!!111!1!

Original thread: https://forums.rpgmakerweb.com/threads/way-to-enable-disable-fleeing-mid-battle.181853/