How would I go about making a skill reset? I'm using the yanfly plugin where you can purchase skills, and I want it to be able to lock someone from a spell if the other choice is learned. If someone doesn't like the skill they can reset for gold and pick the opposit me one. So... How do I make it so a skill can have 2 choices and after one choice the other is greyed out? Also simple reset of learned skills? Not class skills
Skill Reset?
RPG Maker MV SupportAlright so I just ran a test for you and this is what I have.
First give each of the skills you want to do this for this tag in the notes.
<Learn Require Switch: x>
Now make sure both have a different switch value. I'll use 1 and 2 for the example.
<Learn Require Switch: 1> Let's say for Dual Attack.
<Learn Require Switch: 2> Let's say for Double Attack.
With both switches active at the start of the game both of the skills will be available to the user to learn.
Now we want this code in the skills note tag.
<Learn Cost Eval>
$gameSwitches.setValue(#,false);
</Learn Cost Eval>
Where # is the switch number of the skill you want to deactivate after learning the skill. So for my example it would read
<Learn Cost Eval>
$gameSwitches.setValue(2,false);
</Learn Cost Eval>
on the skill Dual Attack and you'd replace the 2 with a 1 on the skill Double Attack.
Now when you learn one skill the other will be removed entirely from being learned because it's switch will be turned off.
Now for the simple reset. The best way to do this is make a skill that resets abilities for a specific Actor.
For example if I have Harold and I have Lucy they both need a different Skill that resets their abilities.
Using the same example above with Dual Attack (3) and Double Attack (4) I also taught Harold Triple Attack (5) if he learns Double Attack. So the Reset skill (11) has the following notetags in it.
<Learn Cost: x Gold>
<Learn Cost Eval>
$gameActors.actor(1).forgetSkill(3)
$gameActors.actor(1).forgetSkill(4)
$gameActors.actor(1).forgetSkill(5)
$gameActors.actor(1).forgetSkill(11) <-- the skill forgets itself so that it can be purchased repeatedly. If you don't add this line it can only reset once.
$gameSwitches.setValue(21,true); <--All switches that can be turned off are turned on so that the skills can be purchased again.
$gameSwitches.setValue(22,true);
</Learn Cost Eval>
The reason you need every character to have a reset is because otherwise they will reset everyone's skills if you put them all into one skill.
If you have any questions feel free to ask. I'll answer as soon as I am able.
EDIT :: Also thank you. You gave me an idea for how to better my own skill system despite not using this plugin for my game. So thanks 😀
First give each of the skills you want to do this for this tag in the notes.
<Learn Require Switch: x>
Now make sure both have a different switch value. I'll use 1 and 2 for the example.
<Learn Require Switch: 1> Let's say for Dual Attack.
<Learn Require Switch: 2> Let's say for Double Attack.
With both switches active at the start of the game both of the skills will be available to the user to learn.
Now we want this code in the skills note tag.
<Learn Cost Eval>
$gameSwitches.setValue(#,false);
</Learn Cost Eval>
Where # is the switch number of the skill you want to deactivate after learning the skill. So for my example it would read
<Learn Cost Eval>
$gameSwitches.setValue(2,false);
</Learn Cost Eval>
on the skill Dual Attack and you'd replace the 2 with a 1 on the skill Double Attack.
Now when you learn one skill the other will be removed entirely from being learned because it's switch will be turned off.
Now for the simple reset. The best way to do this is make a skill that resets abilities for a specific Actor.
For example if I have Harold and I have Lucy they both need a different Skill that resets their abilities.
Using the same example above with Dual Attack (3) and Double Attack (4) I also taught Harold Triple Attack (5) if he learns Double Attack. So the Reset skill (11) has the following notetags in it.
<Learn Cost: x Gold>
<Learn Cost Eval>
$gameActors.actor(1).forgetSkill(3)
$gameActors.actor(1).forgetSkill(4)
$gameActors.actor(1).forgetSkill(5)
$gameActors.actor(1).forgetSkill(11) <-- the skill forgets itself so that it can be purchased repeatedly. If you don't add this line it can only reset once.
$gameSwitches.setValue(21,true); <--All switches that can be turned off are turned on so that the skills can be purchased again.
$gameSwitches.setValue(22,true);
</Learn Cost Eval>
The reason you need every character to have a reset is because otherwise they will reset everyone's skills if you put them all into one skill.
If you have any questions feel free to ask. I'll answer as soon as I am able.
EDIT :: Also thank you. You gave me an idea for how to better my own skill system despite not using this plugin for my game. So thanks 😀
Original thread: https://forums.rpgmakerweb.com/threads/skill-reset.68647/