Flee minigames like in Paper Mario TTYD

Hi !

I'm in the middle of the development of a RPG, and I find the "Escape" command a bit... simple.

Some games gives you a bit of challenge, even when you don't wanna fight, so much that even when you wanna flee (and in a situation where fleeing isn't a problem), you can still fail, stay in battle, and lose one turn.

What I want to achieve is a little gauge showing when selecting "Escape", like in the well known Paper Mario : TTYD

But instead of just smashing a button in order to escape, i'd like something like this :

In order to escape, the player must hit enter when the cursor in the green zone

- The more AGI difference between enemies and actors, thinner will be the green zone

- (optional) The more enemies are on the battlefield, faster will go the cursor (making fleeing numerous enemies that are faster than you logically hard)

- Next attempts after a failed flee are easier (so the player won't be doomed if they encounter three un-escapable demon dogs with 250 AGI just after beating a boss)

I'd be glad to discuss with someone who's interested in making this plugin. I have no idea on how to make JS plugins for MV, but i'm good at finding algorithms

For exemple : to implement the gauge easily, one can use two bars : one green and one red, then draws the red bar on both sides of the green bar. The amount of red drawn over the green depends on the AGI diff, with a minimum and a maximum amount of red, which set in the config

When hitting Enter, the plugin just checks if the cursor isn't in one of the regions covered in red

If it is, flee fails, otherwise, it succeeds

I'm not lazy to do it myself, I'm just... not used to js xD tried to learn but it's definitely not for me.

Hope someone will help me do this !
Bump !
Bump, someone wants to discuss about this ?
Just a suggestion in case you can't get a custom plugin made for this. You can do most of this processing through a Common Event without too much trouble. That's how I create timed-hit gauges for different things during combat in my own game.

The idea is that, once the Common Event is called, you need to keep running a Loop every 1 or 2 frames to change a variable, and you need to update the graphic that the player sees to reflect the value of that variable. You also need to provide a way for the player to stop the Loop and have it evaluate where the variable is. Essentially, if the Variable runs from 0 to 30 and back (reflecting its position on the meter), the player might need to stop it between 14 and 16. Since the meter itself isn't moving, you'd probably only need to continually refresh the graphic for the arrow.

The eventing for the common event might look like this:
Control Variables: Set Variable 99 ("Position of Hit Arrow") to 0
Control Switches: Set Switch 88 ("Direction of Hit Arrow") to ON
Show Picture 91 "Hit Gauge" (Make sure to use Picture IDs that nothing else in combat uses!)
Show Picture 92 "Hit Arrow at Position 0"
Loop
..If Player is pressing C Button
....If Position of Hit Arrow >= 14
......If Position of Hit Arrow <= 16
........Control Switches: Set Switch 89 "Escape Successful" to ON
........Break Loop
......Else
........Control Switches: Set Switch 89 to OFF
........Break Loop
......End Branch
....Else
......Control Switches: Set Switch 89 to OFF
......Break Loop
....End Branch
..Else
....If Switch 88 is ON
......Control Variables: Increase Var 99 by 1
......If Var 99 >= 30
........Control Switches: Set Switch 88 to OFF
......End Branch
....Else
......Control Variables: Decrease Var 99 by 1
......If Var 99 <= 0
........Control Switches: Set Switch 88 to ON
......End Branch
....End Branch
..Erase Picture 92
..If Var 99 is equal to 0
....Show Picture 92: "Hit Arrow at Position 0"
..End Branch
..If Var 99 is equal to 1
....Show Picture 92: "Hit Arrow at Position 1"
..End Branch
..If Var 99 is equal to 2
....Show Picture 92: "Hit Arrow at Position 2"
..End Branch
..(Do this for all values from 3 to 29 - or with a bit of scripting, you can simplify it)
..If Var 99 is equal to 30
....Show Picture 92: "Hit Arrow at Position 30"
..End Branch
..End Branch
..Wait 1 Frame
End Loop
If Switch 89 is ON
..Show Message: "Success! Escaping Battle."
..Abort Battle
Else
..Show Message: "Failure! Couldn't escape."
..Change State: Stun entire party for 1 turn
End Branch
Erase Picture 92
Erase Picture 91

From there, what you need to do is to make the Escape Command run a Common Event instead of its normal built-in code. I don't think any existing plugin does this for the Escape Command (though some might let you do it for the Attack command), but a very simple plugin could be made to do this for you.

Alternatively, instead of a plugin to make the Escape Command run a Common Event, you could completely remove the Escape Command from the menu (several threads have been made for this - just do a search), and add it as a skill for each character. Give the skill super-high "Action Speed" so that it's the first thing to trigger during a turn, and have the skill simply run the Common Event in its Features Box and do nothing else. (You might need to tweak the Scope of the skill - I always forget how this works for skills without an obvious effect.)
This is truly an incredible answer !

Instead of updating the position for every variable value, I think I can move the picture using that same variable so there's only one command

Like : Move Picture : X + Var 99

And set the Var 99 to negative when the cursor goes in the other direction

Original thread: https://forums.rpgmakerweb.com/threads/flee-minigames-like-in-paper-mario-ttyd.116646/