Hi there, I'm using Yanfly's Skill Learn system and I'm wondering if there's a way to use that script to grant a permanent immunity to a particular state (such as confusion or sleep).
Need help making skill that grants immunity to states
RPG Maker MV SupportHey there If I am reading this right what you want can be done a few ways without needing to use the plugin. Depending on how you want to go about it you would add the "State Resist" for whatever state to pretty much any "Trait" window so if you add it to the class or actor window it would be a permanent resist for that actor or class, State Resists are 100% negation by the way. There are other ways to go about it but those would be the simplest. Hope that helps.
I'm not looking to make it a class/character feature unless the player of the game buys it with job points. That's why I mentioned the script, it's my intention for it to be something they choose.
So for a choice you could link whatever is making the choice call to a common event that calls the resist. If its a skill that is bought normally with jp then the I think you would have to make it so that once the skill is used it calls the resist state. It would be easier to use this plugin command to purchase the boost outside of the jp window though. Put like Show choice/Buy Resist/ Don't Buy it. Then the Buy branch would use the plugin command:
loseJp actorId jp
Replace 'actorId' with the ID of the actor you wish to change the JP of. Replace 'jp' with the amount of JP you wish to alter.
loseJp actorId jp
Replace 'actorId' with the ID of the actor you wish to change the JP of. Replace 'jp' with the amount of JP you wish to alter.
Hey there, sorry I've been typing on the go was a little unclear earlier. What you would need to do is make a state, like say Poison Proof. Make that state have no wear off condition and set to to resist poison in the traits. Then however you call it say talk to an npc and get it. The npc can simply apply the state to whatever npc you set it to and can leave out the common event that way. Hope its a little clearer.
While this would work it would be a bit sloppy. I would prefer if it could come from the same menu as the rest of the skills and skill upgrades. I'm planning on having specific skill trees for each character and would rather make sure their methods of acquiring all of their "skills" remained consistent.
So then it would need to be attached to a skill specifically, which leaves you with the issue of it needing to be used which is kind of clunky. unless you set up a common event, parallel process, that monitors for characters who have the skill. So the Common event would have:
Condition Branch if actor 1, has skill, Poison Proof, Add State, Poison Proof.
You would need to set this up for each character that Can get what ever resists you set up, but you can place them all in the same common event.
Condition Branch if actor 1, has skill, Poison Proof, Add State, Poison Proof.
You would need to set this up for each character that Can get what ever resists you set up, but you can place them all in the same common event.
So I know that using the notetags in a skill (using the job point system and skill learn system plugins) its possible to increase parameters like so:
And this can be used to increase the parameter attached to id "x" by "y" amount. Yanfly had a tutorial on his blog about doing this. I was wondering if there's a way I can use this to add a new class/actor trait. I'm sure there is, I just don't know the code for it. If I could do it this way it would be exactly what I'm looking for.
Code:
<Learn Cost Eval>
user._paramPlus[x] += y;
</Learn Cost Eval>
Hmm, I'm not to sure about the limitations of the plugin but the script call looks like
$gameActors.actor(actorId).addState(n);
$gameActors.actor(actorId).removeState(n);
So maybe try out:
<Learn Cost Eval>
user.addState(n) += y;
</Learn Cost Eval>
or:
<Learn Cost Eval>
user._addState(n) += y;
</Learn Cost Eval>
I'm not sure about the _ but then n would be the state id for Poison Proof.
Edit you can probably remove the += Y I believe so it would look like:
<Learn Cost Eval>
user.addState(n);
</Learn Cost Eval>
$gameActors.actor(actorId).addState(n);
$gameActors.actor(actorId).removeState(n);
So maybe try out:
<Learn Cost Eval>
user.addState(n) += y;
</Learn Cost Eval>
or:
<Learn Cost Eval>
user._addState(n) += y;
</Learn Cost Eval>
I'm not sure about the _ but then n would be the state id for Poison Proof.
Edit you can probably remove the += Y I believe so it would look like:
<Learn Cost Eval>
user.addState(n);
</Learn Cost Eval>
Ah there we go
Worked like a charm. Still wish it didn't have to be a state and there was a way to actually add the trait, but I suppose if the end result is the same who cares.
For the record using the above code (replacing "n" with the ID of the state that grants immunity to another state) works, if anyone else wanted to be able to do this. Thanks Jeremaiah for the help!
Code:
<Learn Cost Eval>
user.addState(n);
</Learn Cost Eval>
For the record using the above code (replacing "n" with the ID of the state that grants immunity to another state) works, if anyone else wanted to be able to do this. Thanks Jeremaiah for the help!
Np I'm happy we got this worked out🙂. I know what you mean about having to attach it to a state since the resist exists outside of the state itself but I didn't see a way to adjust that specifically. I'll post a handy link the the script call list it can come in handy, maybe the state resist is hidden in there somewhere but I don't think so, still its where I found the code. Anyways Happy it's working, good luck on your game.🙂
Galv has a plugin called MV Dynamic Traits, which might help you achieve the effect you're looking for without adding a new state in the game. I've found that "Recover All", if used, can sometimes remove some persistent states regardless of utility. Not sure why the game does this, but anyway...
For something like a trait that grants immunity to a certain state, you can use this in a script call:
Galv.DTRAITS.addTrait(actorId,code,id,value);
which, for Actor 1, state ID 4, would be...
Galv.DTRAITS.addTrait(1,14,4,0); <-- 14 is the code for State Resist
OR this...
Galv.DTRAITS.addTrait(1,13,4,0); <-- 13 is the code for State Rate
There are plenty of instructions on setup in the plugin's help file. If you want the trait to be "bought" or "learned", I'm sure there's a way to do that through common event setup. Hope this helps! 😀
For something like a trait that grants immunity to a certain state, you can use this in a script call:
Galv.DTRAITS.addTrait(actorId,code,id,value);
which, for Actor 1, state ID 4, would be...
Galv.DTRAITS.addTrait(1,14,4,0); <-- 14 is the code for State Resist
OR this...
Galv.DTRAITS.addTrait(1,13,4,0); <-- 13 is the code for State Rate
There are plenty of instructions on setup in the plugin's help file. If you want the trait to be "bought" or "learned", I'm sure there's a way to do that through common event setup. Hope this helps! 😀
Original thread: https://forums.rpgmakerweb.com/threads/need-help-making-skill-that-grants-immunity-to-states.79528/