How to know which actor did which action?

Discussion in 'Learning Javascript' started by Khaikaa, Mar 18, 2019.

  1. Khaikaa

    Khaikaa Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    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!
     
    #1
  2. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    978
    Location:
    Buckie, Scotland
    First Language:
    English
    You can do BattleManager._subject in your common event to get the actor whose turn it was when the event was called.
     
    #2
    Khaikaa likes this.
  3. Khaikaa

    Khaikaa Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I knew there should be an easy way to get that info! thank you so much! :)
     
    #3
  4. Trihan

    Trihan Speedy Scripter Veteran

    Messages:
    1,483
    Likes Received:
    978
    Location:
    Buckie, Scotland
    First Language:
    English
    You're more than welcome!
     
    #4

Share This Page