(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
698
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,551
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 Posts

Latest Profile Posts

Check out the Driftwood gamejam submissions, there's some pretty good projects in there.
Define purpose in your own words.
And assuming it doesn't contradict your definition: if someone takes your purpose away, can you get a new one?
At last, my fourth set of random sprites is finished! :kaojoy:
NebhyCL.jpg

Have fun recognizing characters!
The games industry runs on the altruism and passion of its victims.
All I've done today is sleep ; n ; I don't feel like eating my tummy says no I hope you guys are having a good day tho

Forum statistics

Threads
121,959
Messages
1,145,454
Members
160,230
Latest member
TheBOSS12
Top