Force a missed attack

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
Hey, is there a script command to force an (incoming) attack to miss?

I've seen these threads:
https://forums.rpgmakerweb.com/index.php?threads/force-miss-command.62636/#post-604303
https://forums.rpgmakerweb.com/index.php?threads/yanfly-buffs-state-core-help-on-creating-an-always-evade-state.72797/#post-687079
https://forums.rpgmakerweb.com/index.php?threads/force-critical-or-miss.70510/#post-668719

But the solutions involve directly altering either the attacker's hit rate or defender's evasion rate. Would be complicated to factor in for scenarios where a battler already has an altered rate. For eg:

The defender developed a 50% evasion rate through some means. However, using the above methods would change it to 100% evasion (to avoid the incoming attack) and then either leave it as 100% or default back to 0%. Wouldn't it be complicated to retain the previous evasion rate?

That's why I'm asking if there's an equivalent to:
this.actionForceCritical();
this.actionForceNoCritical();

for forcing a miss.

Edit my current attempt using the above methods:

Code:
<Custom Select Effect>
$gameVariables.setValue(99,target.eva);
console.log(target.name() + "'s Current Evasion: " + target.eva);

if ($gameVariables.value(280) == 1){
    target.setEva(100);
    console.log(target.name() + "'s New Evasion: " + target.eva);  
}
</Custom Select Effect>

<Custom Deselect Effect>
    console.log(target.name() + "'s [Pre-Deselect] Evasion: " + target.eva);
    target.setEva($gameVariables.value(99));
    console.log(target.name() + "'s [Post-Deselect] Evasion: " + target.eva);
</Custom Deselect Effect>
To retain their prior evasion rate, I store it in a variable. However, I'm not sure that is efficient or safe. When multiple enemies capable of evading, via this way, are attacked, the coding is run for each of them in order (So the value stored in variable 99 SHOULD be unaffected by another enemy's evasion rate) - in other words, enemy A's evasion rate is managed in variable 99, and then enemy B's evasion rate is managed.

I'm uncertain if this can cause other complications though.
 
Last edited:

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,676
Reaction score
2,122
First Language
English
Primarily Uses
RMMV
If you are using the Yanfly plug-in that calculates the attacker's hit and the defender's evade simultaneously, you could probably just add a state that grants +1000% Hit Rate before the attack and remove it when your done. Might be easier to manage.

If you're not using that plug-in though, the defender can still Dodge the attack, unfortunately.
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
@Frogboy Not sure what plug-in you're referring to off-hand, but I'd check. And what do you mean the defender can still dodge? Are you referring to the currently implemented method in my edited post above? And well, I'd want the defender to always dodge in that case, so wouldn't that be good?
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,676
Reaction score
2,122
First Language
English
Primarily Uses
RMMV
Sorry, I got mixed up with what you were trying to do and was thinking the opposite. I was thinking that you wanted a guaranteed hit instead of miss.

So all you really need to do is create a state which grants at least 100% Evade, apply it to the target of the attack and then remove it after the attack is complete.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,055
Reaction score
10,319
First Language
Czech
Primarily Uses
RMMV
You can use Yanfly's counter control plugin (or how is it called). There is a note tag command that allows you to force the next attack to miss and then have a counter, so if you set the counter to an empty skill, it should work.
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
@Poryg Hmm, I tried that I believe. The problem I encounter is that there is a specific condition for the battler to be able to evade the attack. So I need to set a custom condition for the evade to trigger and that can only be set within a skill - not within the state itself. So as far as I understand, I have to call a skill with that defined. I had the skill do no damage (target no one, etc), but it still gave a "had no effect" message, which breaks the illusion.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,055
Reaction score
10,319
First Language
Czech
Primarily Uses
RMMV
@Rink27 Can you elaborate the conditions? I won't see the problem otherwise.
 

Rink27

Veteran
Veteran
Joined
Jul 18, 2014
Messages
222
Reaction score
13
First Language
English
Primarily Uses
RMMV
@Poryg The attack has to have a certain property to be evaded 100%. At the moment I use a sort of elaborated method with variables, but it's the same as if I had the condition requirement as: the incoming attack must have the Earth element (Instead I'm using something other than elements, but same principle).

Under the skill the counter state calls, there'd be a:

<Counter Condition>
Element: Earth // Instead I have a different requirement here
</Counter Condition>

<Evade Counter>
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,055
Reaction score
10,319
First Language
Czech
Primarily Uses
RMMV
I see now.
Then maybe what about using something like this inside the state?
<Custom Select Effect>
if (whatever conditions){
target.result().evaded = true
}
</Custom Select Effect>
I'm not sure if it works though. Didn't try it.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,055
Reaction score
10,319
First Language
Czech
Primarily Uses
RMMV
Damn... Then there is only one solution that comes to my mind.
Victor engine contains a script that allows you to evade attack elements based on a state. From what I've heard, Victor engine is not incompatible with Yanfly engine, so perhaps it could help.
https://victorenginescripts.wordpress.com/rpg-maker-mv/action-dodge/
You'll need to download Victor engine core with it. But again, it does the same, influencing evasion rates...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

My sister is a saint. Specifically Saint Peter. Because shes my best friend until other ppl are around then shes all "nope, dont know him, dont like him."
Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:
Made idle animation for character. It first had only three frames but looked too different from walking animation and I had to draw five more.

Forum statistics

Threads
95,698
Messages
931,097
Members
126,042
Latest member
pyosong2
Top