(MZ)Remove all skills after changing class

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
267
Reaction score
41
First Language
brazil
Primarily Uses
Hi guys!
Im using this command: $gameActors.actor(1).forgetSkill(800)
But Anyone knows how to forget all skills?
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
631
Reaction score
614
First Language
german
Primarily Uses
RMMZ
With a for loop

Code:
for (let i = 1; i < $dataSkills.length; i++) {
  $gameActors.actor(1).forgetSkill(i)
}
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
4,118
Reaction score
3,380
First Language
English
Primarily Uses
RMMZ
Just a heads-up that Aerosys' solution works, but it's arguably inefficient because it loops through every skill in the game whether your actor has it or not. I would personally do

JavaScript:
const actor = $gameActors.actor(1);
const skills = actor.skills();
for (let i = 0; i < skills.length; i++) {
    actor.forgetSkill(skills[i].id);
}
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
267
Reaction score
41
First Language
brazil
Primarily Uses
Just a heads-up that Aerosys' solution works, but it's arguably inefficient because it loops through every skill in the game whether your actor has it or not. I would personally do

JavaScript:
const actor = $gameActors.actor(1);
const skills = actor.skills();
for (let i = 0; i < skills.length; i++) {
    actor.forgetSkill(skills[i].id);
}
Thanks
 

Latest Threads

Latest Posts

Latest Profile Posts

I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.
After the initial success with one event, I set up four different events on the same map to detect who is in which slot in my current party, and fortunately it managed to work as intended, with the events changing image to match the party members even as I swapped their positions around in formation. This will be a great tool for immersive scene design.

Forum statistics

Threads
118,452
Messages
1,116,086
Members
155,428
Latest member
jlauza
Top