Confirmation on Escape from battle.

Hello. I thought I could solve this problem by myself, but all ideas I had failed...

I want to add confirmation question via common event when player decides to escape battle.
I tried to run common event within plugin and comparing switches/variables, making skills to escape battle and all failed.

Is there any workaround to achieve that?

Are you sure you want escape from battle?
- Yes
- No

When Yes - escape
When No - continue battle
Well, first you should mention if you use any plugins that alter the menu behavior in any way (even Yanfly battle core does).
Nonetheless, it's too much effort for too little game usually, since you don't misclick that unless you're on android. And there's nothing worse than unskippable confirmations on something I might want to do frequently at least through some period of time.
@Poryg Yes, I have Yanfly's Battle Engine Core placed in my game and I altered a little bit Scene_Battle.prototype.commandEscape function so it always team can escape. For the last two hours I was trying HIME plugins to alter Battle Window with custom commands and I admit. I'm getting slowly to the result I expect... I made a dummy skill called Retreat with following action sequence:
Code:
<setup action>

common event: 29

</setup action>

<finish action>

eval: if ($gameVariables.value(23)>0){BattleManager.processEscape();$gameVariables.setValue(23,0);}

</finish action>
common event 29 displays question with choice selection and with that I set variable 23 either to 0 - continue battle or 1 - abort battle.

... And if I would be lazy I could close topic right now, but this solution has one major downsize:

Default escape command is called immediately, but this dummy skill must wait before all actors in party choose their action.
(I'd like to that particular skill - Escape - launched right away after selecting it, skipping all next party members)
I'm not entirely sure I follow. You have an escape skill, but what's the difference supposed to be compared to the actual escape command? Or is it supposed to "be the same"?
When you use default escape command then right away you see a message "Actor's party started to escape". But skills are queued - What I want (for now) is that skill is also right away triggered after usage and skip turn for the rest party members. I try to visualize it more.

Regular escape command:
- Party escapes (or not, depending on escape ratio)

Skill (escape)

actor(1) - uses skill Escape, then it jumps for actor(2)
actor(2) - uses skill Skill A, then it jumps for actor(3)
actor(3) - uses skill Skill B, then it jumps for actor(4)
actor(4) - uses skill Skill C, then all selected actions are triggered (in order set with agi param and skills speed).

As I said, this could conclude my problem, but I wan't to improve it further more.

actor(1) - uses skill Escape, skip all other actors and perform escape
actor(2) - turn skipped, due the escape from battle (actors starting to escape)
actor(3) - turn skipped, due the escape from battle (actors starting to escape)
actor(4) - turn skipped, due the escape from battle (actors starting to escape)

and battle is counted as Escape.
Well, I still don't see the catch other than being able to use escape 4x a turn, but whatever.

I don't want to think about it too much right now as I'm too tired to think about anything. Nevertheless, if the common event works, maybe you can try to place the eval in the damage formula and use the Perform action or how hits are induced. Or in fact you may perhaps even include it in the common event itself if you don't use it for anything else. In case of a successful escape the battle should end automatically (skipping the other party members. If the escape fails, the combat continues normally.
@Poryg - pasting that eval in skill formula didn't work - skill behave the same as before, so I quit this idea and I say, you're right, there is no point implementing it for small games, however I have one last idea how to make it working with plugin, but I can't figure out how to control $gameMessages.setChoices()

I can in plugin show my desired options, but I don't know how to call if user choose option 1 or option 2. But thank you anyway for your effort.
You could just handle that through the common event 29.

Original thread: https://forums.rpgmakerweb.com/threads/confirmation-on-escape-from-battle.108056/