Skills w/ Common Events - Caller's ID

So, I'm going to be brief about my problem here.


Imagine the following situation: A skill with the ID x that Bob knows will trigger, when used, a certain common event to display a message, then, Anna, that knows the same skill will also trigger this common event during the usage, but it will display a different message this time.


My question here is: if there is any possibility of getting the ID of the actor who's using (or calling) the skill so I can handle with the variations inside the common event that is attached to the skill? Since all I've got was the same common event for anyone who's using the skill. I also tried tinkering more deeper with some variable manipulation without using scripts but I didn't have success so far, if someone knows how to solve this problem using any script code or even making a workaround that uses no scripting at all (that would be optimal for my case), you have my thanks.
You can set a variable to a certain value in the damage formula and check it during the common event


something like


v[variable_id]=$game_actors.index(a);damage_formula


This will set the Game Variable with the ID you set to be equal to the index of the user in the $game_actors array. Then you check the value of that variable in your common event to determine which message to show
Not sure if bad syntax or something else, but the variable that is designated to contains the Actor ID does not change at all! I tested with using the skill on field and inside a battle, and the variables remains at 0. Here some images for you to see if I'm not doing anything stupid. Oh yeah, and I tried to change v[27] to $game_variables[27], but no success too.


trouble 1.png


trouble 2.png
ah no, it was a problem on my part...


it should be


v[ID] = $data_actors.index(a.actor)


if it doesn't work for you, just put this snippet into the script editor


class Game_Actor


  attr_accessor :actor_id


end


then on your damage formula just do


v[ID] = a.actor_id


Take note though that the skill should only be usable by actors, else it will cause an error for enemies and as such the game will turn the damage to 0
Much obliged! The only problem was that the common event call was made by the skill before the variable could get the actor ID, but I found a workaround by "silentely" calling another skill by the common event of the first one, and then using all the procedure of another common event in the second skill.
Actually, the problem was simply that I gave you the wrong method... it should simply be


$data_actors.index(a.actor)


Also, Common Events Run AFTER damage (at the end of that "turn" actually,  The mods even posted a thread to show how the whole damage flow works) so everything in the damage formula is actually done already by that time so the variable should already be set by that time... So unless you have a plug-in that modifies the flow of damage, there shouldn't be a need to make two skills.


PS: I'm pretty sure I replied already with my edits yesterday (oh it's on top)

Original thread: https://forums.rpgmakerweb.com/threads/skills-w-common-events-callers-id.55381/