(MZ)Remove all skills after changing class

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
390
Reaction score
91
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
877
Reaction score
879
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
6,019
Reaction score
6,005
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
390
Reaction score
91
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've got good news and bad news. The good news is, there aren't any bad news to report. The bad news is, there aren't any good news to report.

Or as others say, yesterday was uneventful.


I am curious that can you "understand/get the point" about what does this place do generally?
(ARPG game)
If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?

Forum statistics

Threads
129,844
Messages
1,205,657
Members
171,000
Latest member
Nurseval
Top