Limit variable increases to certain enemies?

Hey everyone,

I'm creating "Unison Attacks" for my party which are triggered when behind-the-scenes variables hit a certain quantity. I've successfully created a group melee attack that triggers once all four party members use the basic attack.

However, I'd like to limit it to only executing when all four members attack the SAME enemy. Currently, the party members can split their attacks between multiple enemies and, as long as all four have attacked, the move triggers.

Here are the two events triggered by the Attack skill:

atk combo up:
Control Variables: #0001 Attack Combo +=1

Attack Finale

If: Attack Combo = 4
--> Force Action: Reid, Attack Combo Finale, Last Target
--> Control Variables: #0001 Attack Combo =0

What more should I add to Attack Finale or atk combo up to limit the variable tolling under one enemy...?
Are you using a plugin for this?
Could you try something like this?

Actor 1 attacks Monster 1. Combo +1. Actor 2 attacks Monster 1. Combo +2. Actor 3 attacks Monster 2. Combo gets reset to 1 to restart the counter. You keep doing this until you either reach the combo number needed or the combat ends.

This would require that you track which enemy is being attacked as it happens. I would think you could use the same data of Last Target to determine if the same enemy is being attacked or not. You could use two variables. Last Enemy Target and Current Enemy Target. Then the Last Enemy Target variable gets set equal to the Current Enemy Target in preparation for the next attack.

And I guess it would also depend on the type of combat you are implementing, to some degree.

Not sure if that makes sense.
Are you using a plugin for this?
No, no plugin! Do you know of a good one?
Could you try something like this?

Actor 1 attacks Monster 1. Combo +1. Actor 2 attacks Monster 1. Combo +2. Actor 3 attacks Monster 2. Combo gets reset to 1 to restart the counter. You keep doing this until you either reach the combo number needed or the combat ends.

This would require that you track which enemy is being attacked as it happens. I would think you could use the same data of Last Target to determine if the same enemy is being attacked or not. You could use two variables. Last Enemy Target and Current Enemy Target. Then the Last Enemy Target variable gets set equal to the Current Enemy Target in preparation for the next attack.

And I guess it would also depend on the type of combat you are implementing, to some degree.

Not sure if that makes sense.
That makes a lot of sense! I'm gonna try a couple different ways and let you know if it works.
Could you try something like this?

Actor 1 attacks Monster 1. Combo +1. Actor 2 attacks Monster 1. Combo +2. Actor 3 attacks Monster 2. Combo gets reset to 1 to restart the counter. You keep doing this until you either reach the combo number needed or the combat ends.

This would require that you track which enemy is being attacked as it happens. I would think you could use the same data of Last Target to determine if the same enemy is being attacked or not. You could use two variables. Last Enemy Target and Current Enemy Target. Then the Last Enemy Target variable gets set equal to the Current Enemy Target in preparation for the next attack.

And I guess it would also depend on the type of combat you are implementing, to some degree.

Not sure if that makes sense.
Hey, returning to this: I know MZ has a "Last Target" built in, but it's not a pre-set option for the conditional branch I'm using to make this. Do you know the script to call the Last Enemy Target data? I've looked through an RPGMaker Script Call reference spreadsheet and haven't found anything resembling Last Target. I tried copying the "Last Target" option from MZ into HTML and then pasting it in a word doc, but that didn't help either. Thanks and appreciate your help!
It isn't in the Conditional Branch options. Rather, it is in the Variable options. Here is a screenshot of where it is. You would save the Last Target Enemy Index to a Variable and then use the Variable in the Conditional Branch to check its value. Ignore the one that is highlighted in the image. I highlighted the wrong one.

Last Target ID.png
It isn't in the Conditional Branch options. Rather, it is in the Variable options. Here is a screenshot of where it is. You would save the Last Target Enemy Index to a Variable and then use the Variable in the Conditional Branch to check its value. Ignore the one that is highlighted in the image. I highlighted the wrong one.

View attachment 265225
Forgot to post the follow up, but got it to work yesterday thanks to your help! I'm really excited and feel empowered to make wackier and crazier combination attacks.

Posting a screenshot here in case anyone else is trying to do something similar and is stuck:

1686783507375.png


Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/limit-variable-increases-to-certain-enemies.158256/