Weakness Stunning

Chaos Avian

Abyssal Wing
Restaff
Joined
Jul 16, 2012
Messages
3,230
Reaction score
785
First Language
English
Primarily Uses
Hi there, I've been trying to figure this out, but I've been trying to make hitting a weakness create the benefit. Like Persona 3 and 4, where hitting a weakness gives you another turn except I want to make the result of hitting a weakness a chance of stunning rather than an extra turn. If this can be done, I'd appreciate the help.
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
Could you add a state which gives say stun status a 200% susceptibility? Would that work?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
I think this is a cool idea; the ability to Knock Down characters when you hit their weakness in P3/4 added a ton of danger and strategy to battles.

Took a little while for me to get this working correctly, mostly because I didn't realize I needed to hit both sides of the "if it's a normal attack" branch... but here's a scriptlet that I made for you.  Paste it anywhere below 'Materials' and above 'Main'. I tested it out in a clean project with a fire attack, spell, and item against the ogre (which is weak to fire) and it's working perfectly.

Be sure to replace the "33" with whatever state you want to add to the target when their weakness is hit.

This is something that I may want to turn into a full script so other people (and you) can use it more easily.  Given that the entire mechanic is from Persona anyway, I assume you'd be okay with me doing so? :)

Code:
class Game_Battler < Game_BattlerBase  #--------------------------------------------------------------------------  # * Get Element Modifier for Skill/Item  #--------------------------------------------------------------------------  def item_element_rate(user, item)    if item.damage.element_id < 0      the_rate = (user.atk_elements.empty? ? 1.0 : elements_max_rate(user.atk_elements))    else      the_rate = (element_rate(item.damage.element_id))    end    if the_rate > 1.0      self.add_state(33)    end    return the_rate  end end
 
Last edited by a moderator:

Chaos Avian

Abyssal Wing
Restaff
Joined
Jul 16, 2012
Messages
3,230
Reaction score
785
First Language
English
Primarily Uses
Oh most definitely! This is awesome thanks~ :D
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
You're very welcome.  Enjoy making a strategic battle system with it!!

((EDIT: I edited the previous post to correct where it should be pasted - ABOVE Main, not below.))

((EDIT 2: I just saw you wanted the effect to be a CHANCE to stun upon hitting a weakness.  You can do this by changing the self.add_state(33) line to the following:

if rand(100) < 40 (or whatever percentage you want instead of 40)

self.add_state(33)

end
 
Last edited by a moderator:

YaMaskSey

Villager
Member
Joined
Apr 3, 2016
Messages
5
Reaction score
0
First Language
English
Primarily Uses
Can this be done with critical hits?
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
Can this be done with critical hits?


Yes.


Here's the method in Game_Battler that runs when it is determined that the attack/skill DID Crit:


#--------------------------------------------------------------------------
# * Apply Critical
#--------------------------------------------------------------------------
def apply_critical(damage)
damage * 3
end




So you'll want to modify that method.  Something like:


#--------------------------------------------------------------------------
# * Apply Critical
#--------------------------------------------------------------------------
def apply_critical(damage)
add_state(33)
damage * 3
end


If you're pasting this as a new scriptlet in Materials, rather than modifying the current script, be sure to place class Game_Battler < Game_BattlerBase before it and end after it.


I started making a Battle Effects script a while back, which allows you to apply all different kinds of effects when certain conditions you specify are met on-hit (critical hits and hitting a weakness/resistance are among them).  However, I only completed about half of the possible conditions/effects and the script overwrites several methods so the compatibility is kind of weak.  Right now I'm only continuing progress on this script in the places where I need it for my own games (since I can control my own compatibility issues), but I do plan to write or commission such a script for MV at some point, in which case I'll pay much more attention to compatibility.
 

YaMaskSey

Villager
Member
Joined
Apr 3, 2016
Messages
5
Reaction score
0
First Language
English
Primarily Uses
Well the script works, so I messed around with it and wanted to see if the player can get an extra turn for landing a critical hit using the Free Turn Battle system from Yanfly website, Instead the game crashes when I get a critical, I tried adding both self and user to the add_state but both of them crashes the game. Is there a way to modify the script so the user get's that state?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top