(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
642
Reaction score
620
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,197
Reaction score
3,467
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 think it's by time I make use of this feature in the forums. I'm never one to share profile updates or anything the sort, but hey, you gotta start somewhere! I think I'll use this place primarily to post maps actually, so here, have a goblin cave!

PqleoRp.png

Inspired largely by Wynncraft's Aseado Leaf cave
Does anyone know if Yanfly's Ace scripts are still free for use in both commercial and noncommercial projects? Can't find much except for the wordpress Terms of Use, but not sure if it's not outdated.
I just realized two of My series are beginning to look virtually identical to one another in mechanics and general themes, I never had this problem before.

This is Stifling! Must resolve this!
Lord's Reincarnation III (LR3) MOBILE is coming!!!
iu_534706_7630675.png
ScreenShot_1_20_2022_2_19_41.png
Juice FX is amazing... the portal in the middle is actually animated and moves thanks to Juice FX. so I edited part of a map I have and then drew the portal around it. threw it into Juice FX and now it's lively instead of static.

Forum statistics

Threads
118,711
Messages
1,118,089
Members
155,846
Latest member
blueslime
Top