States give Elemental Weakness

SuperMasterSword

That Guy You Dont Know
Veteran
Joined
Jun 28, 2014
Messages
117
Reaction score
48
First Language
Javascript
Primarily Uses
RMMV
I have to admit I'm kind of surprised I haven't found this anywhere. In the default XP you can make states give elemental resistances. But I want to be able to also make them WEAK to certain elements too. So far I only "need" it to apply to states. But if you feel like coding in compatibility with armor too, don't let me stop you. It's not even that important as I haven't gotten to that part yet, so I can wait. I would appreciate any help.
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
All you need to do is give an Element Rate that is above 100%.

If you want an Ice Sword to make the user deadly vulnerable to Fire, just add "Element Rate  Fire 200%"  The Rate can go anywhere from 0% (Immunity) up to 999% (9.99 times the damage).  If you have Fire attacks inflict a harmful State, you can likewise multiply the State Rate by setting it to 999% (9.99 times more likely to attach the state).

You can attach these to Armor/Weapons/States as needed.

And, yes, they are cumulative because those percentage values are multipliers.  So an Ice Sword and Ice Armor which both give greater Ice resistance and greater Fire vulnerability will stack.

So, no script needed for damage and state calculations.
 
Last edited by a moderator:

SuperMasterSword

That Guy You Dont Know
Veteran
Joined
Jun 28, 2014
Messages
117
Reaction score
48
First Language
Javascript
Primarily Uses
RMMV
Um, actually this is XP. All we have are checkboxes for "Elemental Defense". Which I'm pretty sure halves the damage. I want to make an element do MORE damage. So I either need a script or to see where it is in the code. (And even then a script might be more useful since I don't know how to code and only want this to apply to certain states)
 

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
Sorry about that.   Yeah, I just looked and don't see any obvious way to increase elemental damage in XP.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
So I looked through my XP code and found that I had actually made Sensitivity states that do almost exactly what you're looking for.  In Game_Battler3 you can find damage calculations; I added the following inside the "Apply Skill Effects" method:

# Sensitivity Processing (JTC Custom) if ((self.state?(55) and skill.element_set.include?(1)) or (self.state?(56) and skill.element_set.include?(2)) or (self.state?(57) and skill.element_set.include?(3)) or (self.state?(58) and skill.element_set.include?(4)) or (self.state?(59) and skill.element_set.include?(5))) self.damage = (self.damage * 15 / 10) endSo for example if Element 1 is Fire and State 55 is Fire Sensitivity, using a Fire skill on that character/enemy will deal 150% damage.

You can also add it into the Apply Normal Attack method, replacing the word "skill" in the code with "attacker".
 

SuperMasterSword

That Guy You Dont Know
Veteran
Joined
Jun 28, 2014
Messages
117
Reaction score
48
First Language
Javascript
Primarily Uses
RMMV
You know, I was trying to learn coding and used the Normal Attack method, but it didn't seem to work, although do you think it's because I used nested conditional branches instead of and? I guess I'm just more used to eventing. Also, does 0 count as a state id? Because I was using it on a different state to see if it worked. So, in the default, state 4 should be dazzle, right? And thunder should be element 3? Because I was testing it in the Troop database by going into a test battle with a weapon that was temporarily given the thunder element for the test purposes, and I tried to apply dazzle to them and then attack but the damage didn't seem to change that much. Although instead of what you were doing for the damage I was putting

self.damage *= 2Which should still work right? Of course it might not work at all and I might be an idiot for trying but I'm completely new to Ruby (and coding in general unless you count HTML or CSS...hoping it might be a little start). Anyway, thanks for the help.

EDIT: It seems to be working fine now, although I'm starting to wonder if I had to save for it to work first, I had just been making the edits to the script and then the database and at least applying the changes but from there I just jumped straight from the Troops into Test Battle. Either way if it was my coding or derp not-saving thanks for the help! Much appreciated! :D
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
EDIT: It seems to be working fine now, although I'm starting to wonder if I had to save for it to work first, I had just been making the edits to the script and then the database and at least applying the changes but from there I just jumped straight from the Troops into Test Battle. Either way if it was my coding or derp not-saving thanks for the help! Much appreciated! :D
You're welcome!  And yes, you have to save the project in order for Scripts (and some database elements) to have their changes committed; immediately going to a Battle Test will commit things like changes to a monster's stats, but not other things like Scripts.
 

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