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,142
Reaction score
373
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,230
Reaction score
6,774
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
132
Reaction score
71
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,230
Reaction score
6,774
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
132
Reaction score
71
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

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,612
Reaction score
10,924
First Language
English
Primarily Uses
RMVXA

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 Posts

Latest Profile Posts

You know, I sometimes ponder if working on the story and details is more necessary than the game itself. Its... technically work, just not direct.

Like for me specifically I never stop evolving the story based on what avenues I can approach in gameplay and then I get anxious thinking "hey good thing I thought about that now instead of later". Repeat ad nauseam.
World Of Final Fantasy Livestream~!
(Ft. Kaliga)
So my office building has 8 individually rented offices in it; 3 of which are social workers and 2 are marriage therapists... Unsurprisingly it always sound very angry out there. Glad I have my own private entrance. :LZSexcite: :thumbsup-right:
I wonder if there's ever been an art challenge that involves drawing faces from the generator.

Forum statistics

Threads
94,376
Messages
920,426
Members
124,146
Latest member
Ritea
Top