(MZ)Remove all skills after changing class

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
316
Reaction score
68
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
697
Reaction score
671
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,969
Reaction score
4,549
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
316
Reaction score
68
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 Profile Posts

i got bronchitis ; n ;
I've been trying very hard to distance myself from my inspirations, but maybe It would be better just to accept it.
3uL5XnP.gif
For my 100th post, I wanted to thank this forums community for the generosity and respect that each of you show.

I'm always impressed when I see the 6x veterans (in number of years compared to my presence here on these forums) continue to help and support all the community members on a daily basis, the awesome artists who share their creations with so much passion...
If a person becomes voluntarily missing, does it cause the butterfly effect?
normal_water_is_fine.jpg

Just going to use stationary water for the randomized maps. Sure, particles would look cool... But this is about compromising and not spending countless hours making the perfect water particle for each set piece with water. :kaoswt:

Forum statistics

Threads
121,912
Messages
1,145,150
Members
160,182
Latest member
Toby_YorkTech
Top