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,624
Reaction score
5,104
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,624
Reaction score
5,104
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,624
Reaction score
5,104
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 Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top