Jump to content

Elemental Modifiers

Recommended Posts

This script is no longer supported.


Elemental modifiers

Author: Tsukihime

Type: Damage calculation enhancement




The default engine handles elements pretty plainly.

When you have element rate feature, it adjusts how much more or less damage you take, regardless where you put the feature.


This script changes it so that you can define element rates more accurately.


For example, if your weapon has a fire element rate of 200%, that doesn't necessarily mean you should take 200% damage from fire.



  • Distinguish between elemental damage and elemental resistance.
  • Elemental damage bonus is calculated along with elemental resist


Just copy into your project and set up your game as usual.


Elemental damage is applied to weapons and skills (this means by default, only weapons will alter your elemental damage bonus)


Elemental resist is applied to actor, class, armor, enemy, and states. Basically everything else.


Note that in the database, it is a little different that what you might expect.

Suppose you were adding some element rates to your armor:


100% ice = full ice damage = no bonus

50% ice = half ice damage = 50% resist bonus

200% ice = double ice damage = -100% resist bonus




When you set up your elemental rates appropriately, you can see the results:






Script: http://db.tt/davKgFkZ

Edited by Tsukihime

Share this post

Link to post
Share on other sites

I have a question what will be the damage calculation if the defender has a - 100% resistance to ice while the attack has a 100% ice?

Share this post

Link to post
Share on other sites

I'm thinking 200% (just add weakness and strength together), but not sure if I want to do it that way.


Note: from the database perspective, 100% is "full damage', 0% is "no damage", 200% is "double damage".


Anyways I decided on the following:


if element rate < 100% then resist rate * damage rate

if element rate >= 100% then resist rate + damage rate


Meaning, if you have +50% ice resist bonus, that means you should be reducing all ice damage by 50%. So then the bonus ice damage that you deal is reduced proportionally.


Actor Attack: +200% ice (double damage)

Enemy Resist: +50% ice (halve damage)


So you only deal 100% ice damage, which is basically no bonus.


Actor attack: +200 %ice (double damage)

Enemy resist: -50 %ice (weak against ice!)


In this case, enemy is weak against ice, so you deal 200% + 50% = 250% ice damage, or basically 1.5x bonus.


I think it is more fair than doubling the ice damage to like, 400%.


We could make it more interesting by randomizing which element is inflicted, so it's not always the one that results in the highest damage.

Edited by Tsukihime

Share this post

Link to post
Share on other sites

My game is crashing every time and I get an error every time any actor does elemental magic damage.


Script 'Elemental Modifiers' line 106: ArguementError occurred.
wrong number of arguements (1 for 0)


The elemental effect percent values are displaying in my status menu however.


Also, my damage is all off, and the yanfly "weakness" pop up text is no longer apearing. I'm not using any scripts that effect elemental damage other than yours.

Before your script, I had a weapon that did "piercing" damage type. When I used it on enemies that recieved double piercing damaging, it did 12 damge and a "weakness" popped up.

Now I when I use the same weapon on the same enemy, it does 18 damage, and no "weakness" pops up.

Edited by Xandier

Share this post

Link to post
Share on other sites

Any plan on fixing this script? As the above poster mentioned, on line 106, there's an error:


element_id = item.damage.element_id element_resist_rate(item.damage.element_id) + user.element_attack_rate(item.damage.element_id)


There should be a numerical operator (I'm guessing) between "item.damage.element_id" and "element_resist_rate(item.damage.element_id)". I'm guessing it's supposed to be "-" (minus), since you'd want to substract the resist rate (and then add the attack rate).


EDIT: With my testing, putting the minus sign in seems to work perfectly, and Yanfly's element popups also work normally. I included this script at the top of my script list, right after the feature managers and before Yanfly Battle Engine and Yanfly Element Popup.


Has anyone else had success with this?

Edited by ekomega

Share this post

Link to post
Share on other sites

Honestly I don't actually know what the script is doing there. It's supposed to pick the element that does the most damage, but I have no idea why I wrote it that way.


Weird. LOL.

Share this post

Link to post
Share on other sites

Please do. Or if you wouldn't mind fixing the one line that's broken, if you don't feel like writing it over. I clearly have no idea how these scripts work.


I just changed line 106 in my project to:


element_id = item.damage.element_id


Does that seem reasonable?

Share this post

Link to post
Share on other sites

It would work, but I think it was supposed to first determine which element did the most damage and set that as the element ID.

If you just pick the item/skill's element, it may not be the optimal one.

Share this post

Link to post
Share on other sites

Is it possible to somehow add http://forums.rpgmakerweb.com/index.php?/topic/538-runic-enchantment/ runes to be recognized by the elemental modifier?


When I check the status on elemental resists, added resist runes do not show up. I'm thinking that it is not registering the runes because they are not technically equipped to the actor.






Well as an alternative I decided to use your FP equip script to equip resist runes to the character so they are recognized by the modifier. This way I can keep the the rune slots on gear to adjust other modifiers like +EVA etc, but still being able to give the player options to add resists that will show up in the status.

Edited by Rizzledeep

Share this post

Link to post
Share on other sites

I realized I had another element modification script in my project, and it handles a method for mixing the damage for multiple elements.  It's the Elemental Merger script from this page:




Do you think you could use his method for calculating elemental damage and incorporate it into this script?  Thanks.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

Top ArrowTop Arrow Highlighted