Using YEP_EquipBattleSkills and AutoPassiveStates how do i change a character's entire skill set to another one temporarily when affected by state?

I am trying to use EquipBattleSkills and AutoPassiveStates for this effect but i can't seem to make it work because i don't understand javascript well enough

- Character uses a skill that gives him a state
- This state transforms the character's equipped skills to a specific set (<Custom Apply Effect>)
- After the state runs out (5 turns), the character's originally equipped skills come back. (<Custom Remove Effect>)
Put this in the notebox of the actor or class:


<Equip State: 420>
<Passive State: 420>

Then put this in state 420 (or whatever matches above) that gives the actor the new skilltype

<Custom Passive Condition>

if (user.isStateAffected(69))
{
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

getting rid of the previous skillset can be done if it is initially provided similarly. Just make a different state for their initial skillset (421), equip it via equip state + passive state like above (421 instead of 420), then have it removed like so in the example below, which will occur whenever the state you are casting with a skill is activated. For this example, the state that you are casting which changes skilltypes will be 69.


(state 421)
<Custom Passive Condition>

if (!user.isStateAffected(69))
{
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

Have state 421 provide the skillset that you start with, and state 420 provide the skillset that is replacing the default.

Like so:

1711385835697.png
@Gilgameshed That is not an accurate/complete answer.

Put this in the notebox of the actor or class:
<Equip State: 420>
Equip State is not an actor or class notetag.

<Passive State: 420>
Then put this in state 420 (or whatever matches above) that gives the actor the new skilltype
<Custom Passive Condition>
There would be no reason to make both a state and a passive state, just put the Add Skill Type trait on state 420. I guess the point of what you're doing with the other passive state is making the original skill type actually disappear from the command list rather than just be disabled - but if that's important to the OP, I'd suggest a more CPU-efficient method than unnecessary passive states.

All of that doesn't address the larger part, which is the notion of saving, unequipping, and reequipping skills.

In your transformation state, you put the traits to Add Skill Type of whatever the new skills are, and Seal Skill Type for the original (or for everything else, if it can go on different actors/classes).

Then give it:
Code:
<Custom Apply Effect>
user.oldSkills = user.battleSkillsRaw();
user.clearEquipBattleSkills();
let slot = 0;
// Change the IDs in this list to whatever you want the new skills to be
[1, 5, 19, 52].forEach(skill => {user.equipSkill(skill, slot); slot++;});
</Custom Apply Effect>

<Custom Remove Effect>
user.clearEquipBattleSkills();
let slot = 0;
user.oldSkills.forEach(skill => {user.equipSkill(skill, slot); slot++;});
</Custom Remove Effect>
Not sure what you are talking about ATT, I am using such a setup right now, both in actor and class notetags. Perhaps the equip state is redundant with passive state?

Either way the code works fine if you have Yanfly passive states and yanfly passive conditions.
@Gilgameshed That is not an accurate/complete answer.


Equip State is not an actor or class notetag.


There would be no reason to make both a state and a passive state, just put the Add Skill Type trait on state 420. I guess the point of what you're doing with the other passive state is making the original skill type actually disappear from the command list rather than just be disabled - but if that's important to the OP, I'd suggest a more CPU-efficient method than unnecessary passive states.

All of that doesn't address the larger part, which is the notion of saving, unequipping, and reequipping skills.

In your transformation state, you put the traits to Add Skill Type of whatever the new skills are, and Seal Skill Type for the original (or for everything else, if it can go on different actors/classes).

Then give it:
Code:
<Custom Apply Effect>
user.oldSkills = user.battleSkillsRaw();
user.clearEquipBattleSkills();
let slot = 0;
// Change the IDs in this list to whatever you want the new skills to be
[1, 5, 19, 52].forEach(skill => {user.equipSkill(skill, slot); slot++;});
</Custom Apply Effect>

<Custom Remove Effect>
user.clearEquipBattleSkills();
let slot = 0;
user.oldSkills.forEach(skill => {user.equipSkill(skill, slot); slot++;});
</Custom Remove Effect>
This works perfectly and exactly how i wanted! Thank you all so much!
Not sure what you are talking about ATT
1711388699527.png


I'm talking about the documentation saying Equip State is not an actor or class notetag. And, logically, how could it be? How would it know what skill is equipped to give that state if you put it on an actor or class? It's not like you're equipping the actor or class.

If you have your work duplicated such that the same state is also added in another way, then I can't speak to that 😉

(as a quick note, if you're talking to someone, it's best to Quote or @tag them - not everyone returns to every old thread they leave a comment in to see if there's a response)

Original thread: https://forums.rpgmakerweb.com/threads/using-yep_equipbattleskills-and-autopassivestates-how-do-i-change-a-characters-entire-skill-set-to-another-one-temporarily-when-affected-by-state.167161/