Having trouble making a magic counter skill with YEP Counter Control

Greetings, fellow RPG Makers.  I am hoping that I can get some help with a problem that has been bugging me for a bit.  


I am trying to make a piece of equipment that replaces the guard command for a character in my game project.  The idea is that he will perform a specific counter spell against the first enemy spell that damages him.  My steps have been:


-Create the counter spell: Blast.  I assign this as the default counter through the character's actor page (this is the only access to counters that he will get, so I'm not worried about messing with counter attacks).


-Create a new state: Refract.  This is where I believe I'm having the problem, but I'll explain in a moment.


-Create a new skill: Refract.  This applies the above state in addition to the standard Guard state


-Create a piece of armor with the note: <replace attack: Refract>


All of this appears to work at first glance in a test battle.  I pit the character with the new armor piece in a battle against two enemies.  One attacks with an AoE spell, the other with a standard attack.  My character doesn't counter the magic spell, but he does counter the regular attack.  Everything else seems to work as intended: the guard command is replaced, the proper animation is displayed on his turn when he uses it, he uses the proper counter attack skill, and he only uses it once per turn (I added another physical attacking enemy to test this).


As I said, I believe my issue lies within the state portion of the skill.  Here's what it does:


-The trait section sets his counter attack rate to 100%


-the duration is Turn End 1-1 (will only last through one turn)


-in the note section, I have written:


<Counter Condition>


magical hit


</Counter Condition>


<hit counter>


Naturally, I'm very confused (among other emotions I'm not particularly proud to be expressing in this situation) as to why this not only does not proc on magical attacks, but it does proc on physical attacks.


If anyone can see what I'm doing incorrectly, I would appreciate some help.
I'm going to set up a project with these parameters and plugins to try this myself, but off the top of my head: Why are you creating a state that gives him counterattack rate? Wouldn't that use the game's default counter attack? 


If you're going to use the state, I think you just need to make a blank state and give it a counterattack skill in the notes: 


<Counter Skills: x>


<Counter Skills: x>


Where X is the skill you want the actor to use when countering. That would be the note in the state, so the state is giving the actor the ability to counter with those skills. In fact that's probably where your counter conditions should be too, on the state, not the actor or class. 


If you're giving yourself a special state that counters magical attacks, all of your counter conditions and information should be on that state, based on what I've read. Try that out while I'm fiddling with the project. 


EDIT: If those note tags you provided are all part of the state, I think you have the right idea, but I don't think the state needs to have the counter attack property. There was nothing in the video or the documentation that implied you should use the EX Parameter for countering. 
I'm using a state because I don't want this counter attack to be a passive thing that happens all the time.  The character only counters when wearing this particular piece of armor and using the "guard" command (I say "guard" because I'm replacing it through the piece of armor).  Counter attacking is meant to be a special case for certain characters in my game.  In the magic knight's case, he counters with a magic spell.


I have the counter conditions in the state note section already.  For some reason, the game seems to ignore all the conditions I've set, but it still follows <evade counter> or <hit counter>.  It either counters everything (or just the first action against him, since he only gets one counter per turn), or nothing, depending on how I tweak settings.


As for  the counter attack rate property, when I remove the trait, he stops countering altogether.  I just assumed this plugin was meant to modify the existing counter attack functionality.


I do appreciate you helping out.  I'll try a few more things and see if there isn't something I'm just not noticing.

Did you try doing the counter attack rate in the notes as it's done in the examples on Yanfly's website instead of using the EX Property? 


<Counter Rate: x%>


Yanfly's video demonstrates the exact effect you want. The only difference is that instead of a command directly from the menu, Yanfly's example uses a skill that grants the temporary magical counter-attack state. 


http://yanfly.moe/2016/03/11/yep-82-counter-control/


There may be a good example in the help documentation of the plugin. It's a lengthy one. 


EDIT: I'm testing this out with everything setup just as you've described and ... I can't figure it out either! How annoying! I'll keep scouring for clues ... I can't even get the character to counter a regular physical attack with a specific skill. This is absurd ...

Holy crap!  I think I got it working!


The <counter conditions> can only be applied to skill note tags, not states.  This means I had to put them on the skill I want him to counter with: Blast.  I still had to use the ex parameter counter rate in order to get it to activate, but it is now obeying my orders  🤣 .


Thank you so much!  
Holy crap!  I think I got it working!


The <counter conditions> can only be applied to skill note tags, not states.  This means I had to put them on the skill I want him to counter with: Blast.  I still had to use the ex parameter counter rate in order to get it to activate, but it is now obeying my orders  🤣 .


Thank you so much!  


I'm glad it works for you, now I'm trying to get it to work for me!  🤣


I figured out that the conditions only work inside skills but it still didn't work. But now I think it's because I copied the documentation too closely and use <Counter Skills: 9> for my test. That's what the example had! But it didn't even work on a new project. I switched to using <Counter Skill: Fire> and it works so hopefully I can get this to work on my main project. 


EDIT: I got it to work on a blank project but no counter attacks of ANY kind work on my main project, even with every plugin turned off! Wow this sucks. I didn't even change any of the default scripts ... what the heck. 
Well, how do you have counters set up in your main project?
Well, how do you have counters set up in your main project?



No way in particular. I original tried to do what you did but it wasn't working. I just disabled ALL plugins and gave one of my actors +100% counter rate. He goes into battle, gets hit and ... nothing. He doesn't counter even with 100% counter rate. 
No way in particular. I original tried to do what you did but it wasn't working. I just disabled ALL plugins and gave one of my actors +100% counter rate. He goes into battle, gets hit and ... nothing. He doesn't counter even with 100% counter rate. 



Did you actually disable all plugins?  The counter control plugin is an extension of battle core.  If you disabled that one, I don't know if counter will work.
Did you actually disable all plugins?  The counter control plugin is an extension of battle core.  If you disabled that one, I don't know if counter will work.



Yeah I selected them all and hit "Turn Off" so I think they were all off. 
 


It was something inside of my "Data" folder. Some property in one of the JSON files was messing up counterattacks. I could tell because I made a new project where it worked but when I dragged the data folder from my old project in, it broke again. I really didn't have a huge amount of work done so after someone told me how to copy my plugin parameter info into a new project, I just made a new project and everything works now. 

Be careful with the note properties. A lot of plugins make widespread changes to the game mechanics based on notes so if you have random notes floating around they could really affect your game. I had an issue where I was using BOB_CustomStats and I wanted to make my own property called "zodiac" but I had a custom stat called "zodiac" on a single random actor and it changed the way the property worked and prevented me from being able to set mine. 


Anyway it looks like both of us solved our problems now! Cheers!
Yeah I selected them all and hit "Turn Off" so I think they were all off. 
 


It was something inside of my "Data" folder. Some property in one of the JSON files was messing up counterattacks. I could tell because I made a new project where it worked but when I dragged the data folder from my old project in, it broke again. I really didn't have a huge amount of work done so after someone told me how to copy my plugin parameter info into a new project, I just made a new project and everything works now. 

Be careful with the note properties. A lot of plugins make widespread changes to the game mechanics based on notes so if you have random notes floating around they could really affect your game. I had an issue where I was using BOB_CustomStats and I wanted to make my own property called "zodiac" but I had a custom stat called "zodiac" on a single random actor and it changed the way the property worked and prevented me from being able to set mine. 


Anyway it looks like both of us solved our problems now! Cheers!



Awesome.  Thanks for the heads up, and thanks again for all the suggestions.

Original thread: https://forums.rpgmakerweb.com/threads/having-trouble-making-a-magic-counter-skill-with-yep-counter-control.63497/