RMMV [RMMV] Modifying Escape Chance Mid-Battle

NARFNra

Warper
Member
Joined
Jun 20, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
In Pokemon, there's this move called "Mean Look". It stops your opponent from being able to run away after it's used on them,

I'm interested in making a "Mean Look" like effect in RPGMaker, to make certain encounters inescapable (or at least nearly) at random. I first thought I could solve this issue by using HIME's enemy reinforcements script to add a very very fast invisible and untargetable enemy on turn 0 with a common event, but experimentation has revealed that this doesn't seem to affect your escape chance at all.

So I'm wondering, does anyone know a way or script that lets you do this? One of Yanfly's scripts lets me modify the basic formula that applies to every fight, which is interesting to me because it implies that I should be able to alter the escape chance in real time since RPGMaker keeps track of how many times you've tried to run away to calculate it each turn. Theoretically, it should be possible to just modify the run chance with a script call, right? But I'm not really sure what I would need to write to do so...

So I'm curious as to how one could alter the escape chance in the middle of a battle, and am either looking for a script that specifically supports it or knowledge of what sort of variable I'd need to edit to get this to work with my own script call. I'm currently using a few of the Yanfly battle scripts and so forth, but I don't think they're really relevant to this question.

Thank you!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,865
Reaction score
14,989
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,081
Reaction score
5,750
First Language
English
Primarily Uses
RMVXA
Just as a hint for how you could do it without a full plugin (just a bit of JS code inside a database event or formula): set the value of BattleManager._escapeRatio to a decimal value between 0 and 1 (representing 0% and 100% chance of escape, respectively).

You can see this being used in the "default" escape ratio, which is set only once at the beginning of battle and then normally used for the rest of the fight, even if battlers' AGI changes:
JavaScript:
BattleManager.makeEscapeRatio = function() {
 2331      this._escapeRatio = (0.5 * $gameParty.agility()) / $gameTroop.agility();
 2332  };

For example, you might do something like have the Mean Look skill check whether a "Mean Look" Switch has been set to ON, and if it hasn't yet, make it 5 times harder to escape by using the Script line: BattleManager._escapeRatio /= 5; Just be careful in that you need to reset that switch to OFF at the end of the battle (or, at latest, the beginning of your next battle). Alternatively, if you simply want to make it impossible to escape after Mean Look, your job is much easier: just do BattleManager._escapeRatio = 0; and there's no need to set, reset, or look at Switches.
 

NARFNra

Warper
Member
Joined
Jun 20, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Oh, thank you, that's exactly what I was looking for!
 

Latest Threads

Latest Posts

Latest Profile Posts

Turning a specific vibe into reality is incredibly difficult. For instance, this song is one of the ones I listen to when working on my post apocalyptic project, and getting it's "feeling" into the game has been a real challenge.

I don't just wanna regurgitate the numbers I see, I wanna actually understand the calculations I'm making so I'm probably gonna make a post later with some calculations and what I THINK they mean to get some advice and corrections.

Edit: All (Most) of these will be tested in game prior. I just wanna make sure I understand what's going on under the hood if you will.
my girlfriend calls all my little chibi art cute lol... funny considering that wasn't the original art style of the game.
100 problems in RMMZ 100 more problems take one down pass it around 101 Problems in RMMZ
Made some progress on my game, mostly mapping. Learned quite a bit in the process!.

M6eUoTT.png

Forum statistics

Threads
113,769
Messages
1,077,317
Members
147,804
Latest member
Dracul_JOSHI
Top