Setting a Variable to the Actor ID of the Actor who used a skill

I am trying to set a common event that modifies a variable that can determine between multiple actors who will use the same skill.  How do i set a variable to equal the Actor ID of the actor who last used the skill that is set to run the corresponding common event?
This may not be possible with Variable eventing alone because the Variable modifier only calls an Actor's ID by number, not from using the specific skill or setting it to the Actor ID that used that skill. This might require scripting to accomplish.

Looking through the methods by eventing alone, I am not seeing a solution to this; however, I could be mistaken.

Edit: There is an option for Party Members in Other but that appears to refer to the number of members in the party and not the individual party member. Clarification on this?
I am trying to set a common event that modifies a variable that can determine between multiple actors who will use the same skill.  How do i set a variable to equal the Actor ID of the actor who last used the skill that is set to run the corresponding common event?
The variable system will be unable to support a feature like this without a workaround or script.

I would recommend creating a duplicate of each skill, one duplicate for each actor. Then, you'll be able to have full control over which common event triggers based on which actor is using his/her respective skill. You would need to create a common event to match each skill, too.

An example of this would be to create a skill called 'Magic Missile' that triggers a common event that shows the actor's face with the text "I wanna cast Magic Missile!" In this example, let's assume you have four party members, and each party member can cast the spell. You want to create 4 separate Magic Missile skills in the database, then assign each actor his own Magic Missile skill. You would then create 4 separate common events, the 1st common event showing the 1st actor's face, the 2nd common event showing the 2nd actor's face, and so forth. Then, you assign the 1st common event to the 1st Magic Missile skill which is all assigned to the 1st actor.

Edit: There is an option for Party Members in Other but that appears to refer to the number of members in the party and not the individual party member. Clarification on this?
You are correct, this will set the variable to match the number of party members you currently have with you.
I'm pretty sure this can be done in one way or another, but I can't really look into at the moment. (Working on something)

I don't know how much this will help, but it may provide some clue.

If you add this to your damage formula. $game_variables[1] = a ; (damage formula here), the user of the skill is stored in variable '1'. When I tested this it returned something along the lines of: #<Game_Actor:0x81f4944> in the text box (works for enemies too). I don't know if this will work for your purposes, but I'll look into it later if this hasn't been answered already.

Edit: Actually, now that I think of it, just use: $game_variables[1] = a.id to set variable #1 to the actor id of the last user of the skill. (Again, this works for enemies too)
You don't need that.


Is the skill used in battle or from the menu? If in battle, you can use BattleManager.actor.id and if from the menu, you can use $game_party.menu_actor_id
$game_variables[1] = a.id worked for my healing and attack skills, i'll just rework my skills appropriately n_n  Thank you everyone!
When you use Mark Solved, you actually do it on the post that provides the solution, not on your post saying the problem is solved. In an effort to give credit where credit is due, I have moved it to Rinobi's post.

Original thread: https://forums.rpgmakerweb.com/threads/setting-a-variable-to-the-actor-id-of-the-actor-who-used-a-skill.43264/