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,326
Reaction score
446
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,528
Reaction score
6,870
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
155
Reaction score
94
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,528
Reaction score
6,870
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
155
Reaction score
94
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,791
Reaction score
11,006
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 Profile Posts

My plan after learning to make my voice girly "Wow! You sounds cute!" "But actually I'm a man!" "Nooooo!!!" hehehe...
I get haunted from bugs that emit a terrible stench after being killed.
At first, I was going to put player objectives on the screen labeling it as "Helpful voices"... But that's dumb, I have a madness system. It will simply whisper objectives.... I mean they're probably objectives. The voices wouldn't lie right? They're friendly, and ...helpful. So clearly you should do what they say. Just watch the dark corners of your screen for advice and it will all work out! :LZSexcite:
Take care of your immune system: Go to sleep. If you looked at the clock an hour ago or four and it was way late then maybe now is the time. Mmm sleep...

Forum statistics

Threads
95,667
Messages
930,908
Members
126,004
Latest member
skyfox585
Top