MV Trying to create a melee-only counter using either YEP's "Counter Control" or VE's "Counter Actions"

I may be able to do this some other way that I'm not aware of, but I'm posting this in plugin support since I have two different plugins I've been trying to do it with that are not behaving the way I would expect. Yanfly's Counter Control, and Victor Engine's Counter Actions.

I just want a self-targeting, one-turn status that grants guaranteed counter attack (no limit on number of counter attacks) on melee attacks only (no ranged, which I have as an element, or magic).

The thing is, when I use either of these plugins (and I have tried their respective notetags on the actor, the "attack" skill, and the status, and have tried the status with and without a "counter + 100%" trait) they both do the same weird thing (when the game doesn't crash altogether because some of those combinations are clearly not right): As soon as the ranged enemy attacks (there is one troop I am testing and the ranged one always attacks first), the attack lands (as expected) but then the status goes away! And the melee enemy gets their hit in too (makes sense, the status is gone)! I should also mention, I suppose, that the battle system is Yanfly's CTB.

Without either plugin, the status (which counters ALL attacks) works just fine! It stays until the next turn (well, and is still there; it's on "action end," I still have to figure out how to get more control over how turns work, but that's a whole different task I haven't started yet)



The plugin parameters for Yanfly (I've been messing with it the most, there was some stuff I didn't like about the way VE functioned):

CounterControl.png


Notetag I was trying to use is:



<Counter Condition>

Element: 1

</Counter Condition>
two steps back.

how do you define a "melee attack"? what is the difference between those skills and magic or ranged skills?
you can only make such a counter work correctly if the definition on when to work can be given, and there is no "melee" in the engine itself, so we need to know what definition you added for that.
Counter Control allows for those restrictions by itself, what are you using the VE one for?
Counter Control allows for those restrictions by itself, what are you using the VE one for?
A different method to see if it was easier than Yanfly, but it did pretty much the EXACT same thing, which I thought was interesting. Makes me feel like I'm definitely missing something. Because I had the exact same problem with both.
two steps back.

how do you define a "melee attack"? what is the difference between those skills and magic or ranged skills?
you can only make such a counter work correctly if the definition on when to work can be given, and there is no "melee" in the engine itself, so we need to know what definition you added for that.
Elements. Element 1 is Melee, and Element 2 is Ranged.
The cause is most likely the CTB battle system. It's tick-based, so it messes with how turns are defined for the purpose of state removal.
The cause is most likely the CTB battle system. It's tick-based, so it messes with how turns are defined for the purpose of state removal.
I wondered the more I thought about it, that's why I felt it was important to mention. I haven't tried it without it yet, I guess I should do that to see what happens. But why would it still be fine without the counter control in that case? That's the part I mainly don't understand.

EDIT: Yeah, I tried STB and it still does the same thing
How have you set up your counter state?
You mention that your counter state is an 'action end' state. That could also be the cause, depending on if the plugin defines a counter as a separate action. Can you set it to 'turn end' and see if this fixes the interaction with ranged attacks?
How have you set up your counter state?
CounterStanceState.png


You mention that your counter state is an 'action end' state. That could also be the cause, depending on if the plugin defines a counter as a separate action. Can you set it to 'turn end' and see if this fixes the interaction with ranged attacks?
'turn end' does the same thing; just tried it.
Double-post notice: @xsmittyxcorexYou can also use the +Quote button on several posts to respond to them all in one post, in the future. This time, I've merged your posts together for you.

The way I am reading Yanfly's Counter Control plugin, I believe that the Elements can only be used as a way to determine which skill to use for a Counter action, not whether the Counter action happens at all. Victor's looks like it should do what you want it to, though. Do you have VE's Basic Module installed in your project? If you do, you should be good... although maybe there's an incompatibility with Yanfly's plugin, so I would recommend removing that (or turning it OFF), saving, and seeing if it works any better.
Double-post notice: @xsmittyxcorexYou can also use the +Quote button on several posts to respond to them all in one post, in the future. This time, I've merged your posts together for you.

The way I am reading Yanfly's Counter Control plugin, I believe that the Elements can only be used as a way to determine which skill to use for a Counter action, not whether the Counter action happens at all. Victor's looks like it should do what you want it to, though. Do you have VE's Basic Module installed in your project? If you do, you should be good... although maybe there's an incompatibility with Yanfly's plugin, so I would recommend removing that (or turning it OFF), saving, and seeing if it works any better.
I didn't think I had them on at the same time, but I will try VE's again being more intentional about that and see what I come up with, thank you!



EDIT: So I tried it with this in the State note:


<action counter: element 1, attack, 100%>

And it still does the exact same thing: being attacked removes the state. Actually not only 'Ranged' element but I tried with being attacked by a 'Melee' element first as well, and either way the attack lands, a counter doesn't happen, and the state is then removed. So it seems that I'm using the plugin wrong or something? It's not doing what I would think it's supposed to at all. I could try moving VE's somewhere else in the list, but I'm not sure where. It's at the very bottom right now, and the Yanfly counter one isn't in there at all anymore. I can just experiment with other places to put the tag again, but the State seems like the place to put it, no? Otherwise (if it works) it will just always be active?

EDIT 2: I Forgot to answer: Yes, I do have VE's Basic Module installed
And it still does the exact same thing: being attacked removes the state. Actually not only 'Ranged' element but I tried with being attacked by a 'Melee' element first as well, and either way the attack lands, a counter doesn't happen, and the state is then removed. So it seems that I'm using the plugin wrong or something? It's not doing what I would think it's supposed to at all. I could try moving VE's somewhere else in the list, but I'm not sure where. It's at the very bottom right now, and the Yanfly counter one isn't in there at all anymore. I can just experiment with other places to put the tag again, but the State seems like the place to put it, no? Otherwise (if it works) it will just always be active?
It sounds like you're doing it right, and if a plugin is on the bottom of the list then it wouldn't have its function interrupted by incompatibility issues unless another plugin MASSIVELY changes the way the underlying behavior works. I think you're good on the plugin order front.

Unfortunately I can't think of anything else that may be going wrong. 🙁
Speaking to Yanfly's counter: it doesn't appear that you told the state what skill to use to counter with. Per the documentation, "The target will then generate a pool of skills it can use as counters. It will go in a priority list mentioned in the next section below. The battle system will then go through the pool of skills in order and select the first counter skill that meets all of the conditions required. If no skill is selected, no skill will be used as a counter."

So try this:
1 - In your state, add <Counter Skills: skillId>
2 - In the skill whose ID matches what you entered in step 1, put
Code:
<Counter Condition>
Element: 1
</Counter Condition>
3 - Test.

The part I don't know about is why your state would disappear after a hit. You're sure you don't have any effects attached to the attacking skill that would strip the state? And have you triple-checked that all your YEP plugins are in the correct order according to the list on his site?
Speaking to Yanfly's counter: it doesn't appear that you told the state what skill to use to counter with. Per the documentation, "The target will then generate a pool of skills it can use as counters. It will go in a priority list mentioned in the next section below. The battle system will then go through the pool of skills in order and select the first counter skill that meets all of the conditions required. If no skill is selected, no skill will be used as a counter."

So try this:
1 - In your state, add <Counter Skills: skillId>
2 - In the skill whose ID matches what you entered in step 1, put
Code:
<Counter Condition>
Element: 1
</Counter Condition>
3 - Test.

The part I don't know about is why your state would disappear after a hit. You're sure you don't have any effects attached to the attacking skill that would strip the state? And have you triple-checked that all your YEP plugins are in the correct order according to the list on his site?

I tried this and also just went through every plugin to make sure and it still happens. I did:

"<Counter Skills: 1>" In the the Counter State Note and
"<Counter Condition>
Element: 1
</Counter Condition>" In the Attack Skill Note

I do have other notetags, but I tried it without those so it only has that one and it still happens (with all of Yanfly's plugins that I'm running in the correct order).

Now, I am running quite a bit at this point, from a few different plugin devs with some in the middle of the Yanfly list, so I may try recreating in a clean project (I was avoiding that because it seemed like a lot to set up in this instance) and see what happens...But I still don't know why that would affect anything as:

A. There aren't really any that should be action/turn oriented, or even battle oriented (other than aesthetically), except VE's Unreachable Targets

B. The State works just fine without either of these two plugins we're talking about being active.


EDIT: I JUST MADE A BREAKTHROUGH!!!
So, IDK what it is that's different about everything form earlier, but with everything as is above, it DOES work for 'melee' element enemies, it's just that 'ranged' element enemies, instead of ignoring the counter, remove the state!
I also replicated this in a fresh project, and it doesn't have this issue! the second element enemies just ignore the counter, but the state remains! So something is indeed interfering, I just haven't figured out what yet.
I'm glad that configuration for the notetags works. Have fun turning each plugin off one at a time to find the culprit >_>
SOLVED!!!

My word, thank you all for your help and patience; that was a rough one for me! Now I just need to figure out how to get the animation for it to work how I want, but I have some ideas. Thank you so much!
@xsmittyxcorex You ought to post what the conflict was, on the off chance that someone else encounters that situation.
@xsmittyxcorex You ought to post what the conflict was, on the off chance that someone else encounters that situation.
Well, see, uh....here's the awkward facepalm bit that I was seriously considering just not mentioning and no one would have to know (In reality I wanted to cry more than jump for joy):

It wasn't a plugin at all. The conflict was my oblivious *** wasting everyone's time by not seeing I had the attack skill set to remove the counter state.....

....yeahhhh.....it was from a previous iteration of the idea that I guess I never deleted, completely forgot about, and didn't see because I was paying attention to the State mostly, and the Note box in the Skill, not the whole thing 🙄 Didn't even occur to me.
Don't even feel bad, my guy. It happens. Hell, Turan even noted it as a possibility because it is a thing that can happen to anyone. I see it as a perfectly reasonable little oversight.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-create-a-melee-only-counter-using-either-yeps-counter-control-or-ves-counter-actions.134613/