How do I detect the skills of a variable actor?

What do you mean by which props the player used?
Also, are there many different items that are skill reels, or is there only 1 database item that is the skill reel?
Either way, I can think of some code to add, but I'd like to know that, first, as it will change what I need to write.
oh props, Google translation is always so interesting.
I mean item, like"skill 4", "skill 5", "skill 6", When the player uses "skill 4", the actor learns skill 4, and the item is consumed, but if the actor has learned skill 4, the item is still consumed, so I have to give it back to the player.
So you're saying each skill has it's own individual item?
So you're saying each skill has it's own individual item?
yes, Each skill has an item. If it's too trouble, I can set up a separate common event for each skill item, which is not necessary.
Ok, well I came up with a solution (that I hate) that will allow you to just use Notetags to specify which items are teaching skills.
Replace the code in the .js file with this

let spAlias_GameActor_consumeItem = Game_Actor.prototype.consumeItem;
Game_Actor.prototype.consumeItem = function(item){
let temp = item.note;
let efx;
let skill;
if(temp.includes("SkillReel")){

efx = item.effects.filter(function(obj){return obj.code == 43})
if(efx.length > 0){
skill = efx[0].dataId;
if(this._skills.contains(skill)) $gameParty.gainItem(item, 1);
}
}
$gameVariables.setValue(1, this._actorId);
spAlias_GameActor_consumeItem.call(this, item);
}

Inside of the notebox in the database of ANY item that adds a skill, type
SkillReel

Also, use the effects section of that item to add the skill. Now, when you consume the item, it will teach the skill. If the target already knows that skill, it simply adds the item back into inventory.
Ok, well I came up with a solution (that I hate) that will allow you to just use Notetags to specify which items are teaching skills.
Replace the code in the .js file with this

let spAlias_GameActor_consumeItem = Game_Actor.prototype.consumeItem;
Game_Actor.prototype.consumeItem = function(item){
let temp = item.note;
let efx;
let skill;
if(temp.includes("SkillReel")){

efx = item.effects.filter(function(obj){return obj.code == 43})
if(efx.length > 0){
skill = efx[0].dataId;
if(this._skills.contains(skill)) $gameParty.gainItem(item, 1);
}
}
$gameVariables.setValue(1, this._actorId);
spAlias_GameActor_consumeItem.call(this, item);
}

Inside of the notebox in the database of ANY item that adds a skill, type
SkillReel

Also, use the effects section of that item to add the skill. Now, when you consume the item, it will teach the skill. If the target already knows that skill, it simply adds the item back into inventory.
ok, I will try it, thank you.
Wait! I figured it out.

Create a .js document and save it to your plugins folder. In that document, save the following code

let spAlias_Game_Actor_consumeItem = Game_Actor.prototype.consumeItem;
Game_Actor.prototype.consumeItem = function(item){
$gameVariables.setValue(1, this._actorId);
spAlias_GameActor_consumeItem.call(this, item);

}


With this code, whenever you consume an item, the actor who consumed it will have their ID placed in variable 1. Its an archaic and quick fix, but with this code, you can just check Variable 1 (or change it in the code to whichever variable you prefer) when you run that common event. It will have the ID of the actor who just used an item from the Items menu.
I used this plugin, but it made a mistake. I can't use it even in a new project.
I found that as long as the skills of the item have been learned, the item can not be used. This is the function of the game itself.
I am so sorry, I seem to have asked some strange questions.
Your quote is first example I showed you, did you try the second one? It worked for me. Consuming the item would add the skill if my character didn't have it. If they already had the skill, it would add it back. Make sure you try the second example, replace the first example with the code from the second.
Your quote is first example I showed you, did you try the second one? It worked for me. Consuming the item would add the skill if my character didn't have it. If they already had the skill, it would add it back. Make sure you try the second example, replace the first example with the code from the second.
About this, as I said earlier, if the actor already has that skill, the item cannot be used on him.
Even without plugins, the game itself has this function.
I'm not sure what you mean, because I just tested it again and it works fine for me. It adds the skill if my actor doesn't have it, returns the item if they already have it.
I'm not sure what you mean, because I just tested it again and it works fine for me. It adds the skill if my actor doesn't have it, returns the item if they already have it.
I mean, if an item has the effect of learning the skill, if the actor already has this skill, you can't use the item on the actor, even if you don't use the plugin, the game itself has this function.
—— I just discovered it.
.....I'm not gonna argue with you lol I would recommend however that you re-read what I posted. We don't live in a world where it works on my computer but not on yours.
.....I'm not gonna argue with you lol I would recommend however that you re-read what I posted. We don't live in a world where it works on my computer but not on yours.
well, Maybe my description is not accurate enough. I designed an item. Using this item, the actor can learn skill 4. When he learns skill 4, I can't use this item for him. So I don't know if the second plugin will work, because I can't use it for actors anymore. That's it.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-detect-the-skills-of-a-variable-actor.113992/