How to know which actor did which action?

Hi everybody, I'm Khaikaa, a little game developer. As you can see by my registration date, I'm here since a few, but never posted anything until this momment.

I just started to mess with the code and I find it a bit hard to follow. I was wondering if someone with enough experience could give me a hand with the following issue:

I want to control some battler's info through common events called by skills(so I can do things such as changing classes inside battle and stuff). I know I can get info using some code such as $gameParty.battleMembers()[0].actor() (so I can get info from the first battler of my party). The problem is that I have no idea about how to know which actor called the skill/common event. I'm sure this may be so easy, but I just couldn't figure it out by myself.

Please, I'm not interested in plugins or stuff which do this kind of things by themselves, I want to know how can I do this by myself.

Thank you!
You can do BattleManager._subject in your common event to get the actor whose turn it was when the event was called.
You can do BattleManager._subject in your common event to get the actor whose turn it was when the event was called.

I knew there should be an easy way to get that info! thank you so much! 🙂
You're more than welcome!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-know-which-actor-did-which-action.106934/