Null Elements question

Question. Is there a possible way to make the nul elements similar to FF10 exactly like that?
What I mean is lets say my character uses nul fire. Nul fire nullifies all attacks of fire; however, can only protect their allies one time from fire attacks. When the fire attack hits them, the nul fire energy disappears. I tried looking to see if this setup is possible, but I feel it has to be scripted.

An example:

Beginning of the clip is what I am talking about. Though doesn't show demonstration to the after effect if those characters are attacked by those elements.
You can force every skill to remove the effect, as far as i know damage is done after the buff is applied by default
If you try to remove the state in the damage formula the actor will suffer damage instead
A skill is not a resource. And Resources is for when you are sharing a resource with the community, not asking a query.

Moved to: RPGMaker MV

You could do this easily in the Damage Formula box. I know the Ace (Ruby) syntax, but not the Javascript - I'll give it so that you (or a reader of this thread) can do the conversion.

Nulfire inflicts the ally with the state Nulfire. The enemy's fire skill is what removes it. For the sake of the example, this is state 87.

b.state?(87)?b.remove_state(87) : normal damage formula here

That checks if state 87 is present. If it is, it simply removes the state but does no damage. If the state is not present (it has not been inflicted, or has been removed) normal damage is done.
@Kes i don't use this kind of stuff often, but...

if (a.isStateAffected(10)) a.removeState(10); normal damage formula here
Sorry, been away for a while. Good to see there's a response on this one, so I can test it. Thank you!
The idea did not work.
Bump. Problem is still not solved and now ready to start making the nul elements
The idea did not work.
That should have worked, can you give us some details what exactly went wrong, including screenshots of both state and one example skill?
Bump. Problem is still not solved and now ready to start making the nul elements
This one is easy if you're using Yanfly's Buffs & States Core plugin.

How to make a 'nul element' like state from final fantasy X:
Paste this on your nul element state notebox
Code:
<Custom React Effect>
var fire = x;
if (this.isHpEffect() && value > 0) {
   if (this.item().damage.elementId === fire) {
     var stateId = y;
     target.startAnimation(53); 
     value = 0;
     target.removeState(stateId);
   }
}
</Custom React Effect>

You just need to change the value of 'x' to the element ID you want to nullify (you start counting from 1). And replace 'y' with the id of the actual state to remove it.
I'll just post what I have first.

upload_2017-12-6_15-0-42.png


Spaced and entered it so it's clear. Even used that formula in state and didn't work.

As for the small code, that didn't work either. The var fire ID would be impacted by blaze, which is 11. The state of Nul Fire var number will be 23.

<Custom React Effect>
var fire = 11;
if (this.isHpEffect() && value > 0) {
if (this.item().damage.elementId === fire) {
var stateId = 23;
target.startAnimation(53);
value = 0;
target.removeState(stateId);
}
}
</Custom React Effect>
@Aurawhisperer
The code you were given belongs into the damaged formula field, that is why you were told to place "normal damage formula here".
Please type the front part into the damage formula box, before your normaldamage formula
I think it doesn't work because you have mistaken element ID with your skill ID.

You are going to replace X with one of these values:
Spoiler
u7Sacj7SxtXVs6TmEYH6ub3G9gRdURCbK19qfOdeKVBHUFgUDyFuwhq0pfQwtd4DeJJ522MBgFykCi7eW1XK=w1366-h629

And you're going to replace y with the id of your own null element sate ID.

This piece of code has nothing to with the skills themselves, you just need to be sure the element of the skills you're trying to nullify matches the value of x on your state. I think this is waaaay more efficient than having to modify every single damage formula for every skill.
So the code does work, but I'm getting this error

upload_2017-12-6_15-56-40.png


Here is the formula that I put into the damage formula:
if (a.isStateAffected(23))a.removeState(23) : 5 * a.mat - 2 * b.mdf

Sorry for the confusion by the way. Been very used to note tags heh
I think it doesn't work because you have mistaken element ID with your skill ID.

You are going to replace X with one of these values:
Spoiler
u7Sacj7SxtXVs6TmEYH6ub3G9gRdURCbK19qfOdeKVBHUFgUDyFuwhq0pfQwtd4DeJJ522MBgFykCi7eW1XK=w1366-h629

And you're going to replace y with the id of your own null element sate ID.

This piece of code has nothing to with the skills themselves, you just need to be sure the element of the skills you're trying to nullify matches the value of x on your state. I think this is waaaay more efficient than having to modify every single damage formula for every skill.

Your img was deleted :/
I think it doesn't work because you have mistaken element ID with your skill ID.

You are going to replace X with one of these values:
Spoiler
u7Sacj7SxtXVs6TmEYH6ub3G9gRdURCbK19qfOdeKVBHUFgUDyFuwhq0pfQwtd4DeJJ522MBgFykCi7eW1XK=w1366-h629

And you're going to replace y with the id of your own null element sate ID.

This piece of code has nothing to with the skills themselves, you just need to be sure the element of the skills you're trying to nullify matches the value of x on your state. I think this is waaaay more efficient than having to modify every single damage formula for every skill.

Ahhh, now that one worked! Heh, guess I need to think outside the box and not focus too much on skills, states, or notetags and think about the types.

Well thank you for the help guys. Either one works to be honest, with exception of that error xD

I like to request this solved and closed. Also be best for this kind of post to stay as a sticky in case somebody else wants to use this kind of idea. Be very useful for green mages and white mages!

Original thread: https://forums.rpgmakerweb.com/threads/null-elements-question.83057/