Searching for a specific command

Hello.

Is there a way for me to search for a specific command and not an event?

I've been testing my game and found a bug which I can't seem to figure out. The main character starts as a class with Heal and another skill. However, at some point in my testing it suddenly had those skills gone and instead it had Thunder. I have no idea how that happened, so I suspect I have a leftover command somwhere and I can't find it. Is there any sort of tool or plugin for such scenarios?

Thank you
Not really.

You could have changed the actor's class, or you could have had something remove those skills and add the other.

Save this into your plugins folder (any name, with a .js extension) and play with the console on (hit F8 when playing, and go to the Console tab). When a skill is learned or removed, you'll get the buzzer sound and the console will show some output. Then you'll just have to figure out what event triggered it. This might not work if it was done through a plugin.

Code:
var shaz_Game_Actor_learnSkill = Game_Actor.prototype.learnSkill;
Game_Actor.prototype.learnSkill = function(skillId) {
  shaz_Game_Actor_learnSkill.call(this, skillId);
  SoundManager.playBuzzer();
  console.log('Learned skill ' + $dataSkills[skillId].name);
}

var shaz_Game_Actor_forgetSkill = Game_Actor.prototype.forgetSkill;
Game_Actor.prototype.forgetSkill = function(skillId) {
  shaz_Game_Actor_forgetSkill.call(this, skillId);
  SoundManager.playBuzzer();
  console.log('Forgot skill ' + $dataSkills[skillId].name);
}

I haven't tested this, so if it doesn't work or you get any errors in the console, come back and post them.
Thank you, I'll give it a shot. Also, I forgot to mention, there is no class with Thunder at all, there was one before but I removed it long ago, and I honestly don't remember ever making a command to remove such skills, I can't seem to reproduce the bug.... So I'm very puzzled about what happened. Even thought so far I haven't managed to reproduce it, so the concern exists that the bug is still there.
You didn't just load a saved game that was made when you DID have that skill attached to a class, did you?
I don't think so, since it's registered in the second save slot and I didn't used it until recently...
I'm pretty sure all assets such like actors, experience and all stats are updated even in old saves right? What you say seems to be the only explanation despite of me being sure I didn't use that save slot... I'll keep checking what happened. I appreciate the help you are providing though! Thank you very much.

Also, about the plugin you sent me, it does buzz, but it does at the title screen. So maybe is not working as intented? But in any case if the bug doesn't appear anymore (if it's even one), I suppose the plugin wont find it regardless.
I'm pretty sure all assets such like actors, experience and all stats are updated even in old saves right?
no, that is wrong.

some things are updated because they need to be loaded again, but a lot of other things are not.
for example changes in the plugin manager are never updated in savefiles, requiring you to start a new game whenever there is a change in the plugin manager.
and some actor data will stay as well (that is why there is the initialize option on the change member command - it's there because actor data specifically is not updated unless commanded to do so.
I see, so characters could retain skills even if they are changed in the database later, correct? So the character having thunder from a past class could be why it happened?
But despite of that though, I think I never used that save slot, I checked the date in which the save was created and it says yesterday, and I deleted that class long ago... Unless the creation date of the saves also updates. Even though the 1st save creation data says it has months and I use it all the time. Maybe the only way to pinpoint the issue is waiting until it happens again.
there are a lot of things that could have happened to get that result.

for example you could have change the skill IDs. The game remembers "skill number x learned", it does not remember the skill names. If the actor had skill #17 learned at a time it was for example a healing skill, and you then reorganise the database so that skill #17 is now a poison skill, then the game will list the actor as knowing the poison skill - it cannot identify the other skill number where you moved the healing to.
or you could have used yanfly's class change plugin - that plugin even has a specific description on how to handle skills because too many users ignored the basics and ended up with every character having every skill as soon as the class change plugin was installed.
or half a dozen other ways that we can't even guess without knowing more about your project.

Original thread: https://forums.rpgmakerweb.com/threads/searching-for-a-specific-command.116319/