How to Reference the Current Actor Target in Script

Status
Not open for further replies.

KineticDog

Villager
Member
Joined
May 13, 2019
Messages
19
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hi, everyone. I'm currently writing some scripts in order to implement a new graphical feature in battle scene. One important information I need for this task is the targeting information on the battleground (Who is targeting who with which skill). After some research, I found that BattleManager._action is a good place to get most of the data I need. During the attack from an actor to an enemy, the data would look like:
Code:
{
  _subjectActorId: 1,
  _subjectEnemyIndex: -1,
  _forcing: false,
  _item: {
    _dataClass: "skill",
    _itemId: 12
  },
  _targetIndex: 2
}
In the data above, I know that actor 1 is attacking target with index of 2. Now the problem is: When an enemy is attacking an actor, the data would look like:
Code:
{
  _subjectActorId: 0,
  _subjectEnemyIndex: 2,
  _forcing: false,
  _item: {
    _dataClass: "skill",
    _itemId: 29
  },
  _targetIndex: -1
}
In this data, I get that enemy with index of 2 is attacking someone, but I have verified it multiple times and confirm that neither _subjectActorId nor _targetIndex shows the real actor been attacked. Even if an enemy attack the teammate 4, the _subjectActorId still displays 0.

Now I have no clue about where to continue searching for the solution. Could someone provide me with some guidance on any other data object that could get this information? I would be grateful for your help
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,523
Reaction score
1,415
First Language
English
Primarily Uses
RMMV
Try BattleManager._targets
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,533
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top