Is there a way to check which actor is being targeted at the start of a turn?

Status
Not open for further replies.

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
54
Reaction score
8
First Language
English
Primarily Uses
RMMV
I'm trying to come up with a way to visually indicate which character is about to be attacked by putting an animation over them at the start of a turn. Though I'm not quite sure if there's a way to do this without having the enemy have scripted targets.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,298
Reaction score
436
First Language
Dutch
Primarily Uses
RMMV
I think its not possible though, unless you kinda force it with one of yanfly plugin and use some coding,
otherwise, it needs a plugin, but still, I'm not sure if it is even posible, but it really depends on the
how and why you want to know which actor is being attack.

will you be able to heal that person, special attack, or other way around to block, dodge something?

more details how you want a battle is how other can help you more on the spot of your issue.
we can not guess whle it might not resolve your issue if not specific.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,513
Reaction score
6,867
First Language
German
Primarily Uses
RMMV
even completely ignoring the coding complexity, there is another big problem with this:
what do you do with several enemies targeting different actors in a turn?

Simply placing a mark on every target will not be enough to show which enemy will attack which actor, that would require at least colored or named marks.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
54
Reaction score
8
First Language
English
Primarily Uses
RMMV
I think its not possible though, unless you kinda force it with one of yanfly plugin and use some coding,
otherwise, it needs a plugin, but still, I'm not sure if it is even posible, but it really depends on the
how and why you want to know which actor is being attack.
I'm using this in conjunction with Yanfly's Row Formation plugin. The idea is that I want a specified actor to be highlighted as a warning sign, If the actor does not adjust their position they will be damaged.

I was just wondering if there's any change in code I can look at or if all targets are only decided once an enemy uses an action.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
152
Reaction score
93
First Language
French
Primarily Uses
RMMV
Hi, from my understanding, enemy targets are decided at the action level, meaning that they choose target when it's their turn to act. So, my guess is that it would require a plugin that heavily alter the default engine targeting mechanics.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
54
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hi, from my understanding, enemy targets are decided at the action level, meaning that they choose target when it's their turn to act. So, my guess is that it would require a plugin that heavily alter the default engine targeting mechanics.
I was afraid to hear that. Is there no way to at least fake it?
i.e. rolling a number between 0 and 3 at the start of every turn and forcing the enemy to target those indices?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,513
Reaction score
6,867
First Language
German
Primarily Uses
RMMV
yes, that can be done. you can give one actor a state that increases the target rate and all other actors get one that reduces the target rate to zero. that will change the target randomness of the enemy skills toward the actor with the increased target rate.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
54
Reaction score
8
First Language
English
Primarily Uses
RMMV
Thank you all for the responses but I think I've found a suitable workaround with Yanfly's Action Sequences plugin.
I've decided to have a random number saved to a variable at the start of a turn and then when the skill is executed I'll have that variable called and applied to a targeting action with Yanfly's system.
 
  • Like
Reactions: TSR

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
152
Reaction score
93
First Language
French
Primarily Uses
RMMV
i.e. rolling a number between 0 and 3 at the start of every turn and forcing the enemy to target those indices?
If you can get a hand on YEP_Target core, you could try to force enemies to target an index refering to a variable that you would set at the start of turn by using this notetag in the regular attack skill notebox (or any skill you want to behave as such):
Code:
<Custom Target Eval>
  if (user.isEnemy()) {
    let index = $gameVariables.value(X);
    target = ($gameVariables.value(X) <= $gameParty.aliveMembers().length) ? targets.push($gameParty.aliveMembers()[index]):targets.push($gameParty.aliveMembers()[0]);
  } else {
    for (let i in foes.aliveMembers()) {
       if (foes.aliveMembers()[i] === target) {
         targets.push(foes.aliveMembers()[i]);
       }
    }
  }
</Custom Target Eval>
Edit: @Papillon
I guess that would work too. Good luck!
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
54
Reaction score
8
First Language
English
Primarily Uses
RMMV
If you can get a hand on YEP_Target core, you could try to force enemies to target an index refering to a variable that you would set at the start of turn by using this notetag in the regular attack skill notebox (or any skill you want to behave as such):
Code:
<Custom Target Eval>
  if (user.isEnemy()) {
    let index = $gameVariables.value(X);
    target = ($gameVariables.value(X) <= $gameParty.aliveMembers().length) ? targets.push($gameParty.aliveMembers()[index]):targets.push($gameParty.aliveMembers()[0]);
  } else {
    for (let i in foes.aliveMembers()) {
       if (foes.aliveMembers()[i] === target) {
         targets.push(foes.aliveMembers()[i]);
       }
    }
  }
</Custom Target Eval>
Edit: @Papillon
I guess that would work too. Good luck!
I'll give this a try too. Thank you for the help!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,787
Reaction score
11,004
First Language
English
Primarily Uses
RMVXA
[CLOSED].[/CLOSED]
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

The main character for the first game was originally going to become a member of the party in the third game but I'm probably changing him to an important NPC instead. That brings the third game's total ensemble roster down to nine with one optional secret character.
Please check out my threads here:

1920's Character Sprites

As well as my YouTube channel:

Let's Play - 1927: The Age of Cthulhu
hi i would like to know if you could help me i am looking for resources for the character generator
I need medieval clothes, demon horns
Stress testing my latest version of the game with my new madness engine. :LZSexcite:

Hello, where can I find the list of all watched threads? I've been using the Watch function to save the Threads I want to keep but I don't find the list anywhere....

Forum statistics

Threads
95,588
Messages
930,289
Members
125,893
Latest member
Butabooth
Top