MV YEP Critical Control and 0% Crit Rate when Actors "Attack" without equipped weapons

As title says.

I had the idea where, instead of a normal critical, actors perform a Weapon Unleash when they crit and they are using the "Attack" skill. For this, I need said skill to be unable to crit if 1) an actor is using this skill, and 2) said actor has a weapon equipped). YEP's Critical Control does allow the crit rate of a skill to be set through that skill, but so far I've been successful in only disabling actors from critting. For the curious, here's what I've tried using:

Code:
<Critical Rate Formula>
if (user.isActor() && user.weapons().length !== 0) {
    rate *= 0;
}
</Critical Rate Formula>

Code:
<Critical Rate Formula>
if (user.isActor() && this.hasNoWeapons()) {
    rate *= 0;
}
</Critical Rate Formula>

Code:
<Critical Rate Formula>
if user.weapons().length !== 0) {
rate *= 0;
}
</Critical Rate Formula>

I appreciate the incoming education and assistance.

EDIT: effin' typo
I'm sorry, I don't understand your question.
I need said skill to be unable to crit if 1) an actor is using is, and
What does this mean? An actor is using what?
2) said actor has a weapon equipped).
Okay. Just to mention it, I'm not sure why you multiply the rate in all of your examples, just say it's zero. rate=0;
Code:
<Critical Rate Formula>
if (user.isActor() && user.weapons().length !== 0) {
    rate *= 0;
}
</Critical Rate Formula>
This looks correct to me. You have this on the Attack skill and your actors are still critically hitting? Do you have any notetags on the weapons being used that would overwrite it?
Code:
<Critical Rate Formula>
if (user.isActor() && this.hasNoWeapons()) {
    rate *= 0;
}
</Critical Rate Formula>
This also looks fine.
Code:
<Critical Rate Formula>
if user.weapons().length !== 0) {
rate *= 0;
}
</Critical Rate Formula>
This is the same as the first one, except it doesn't do the actor check and it has a syntax error where you don't have an open parentheses after the if.

So all three of these look like they should work based on your second criteria, so the big question is what is #1 supposed to say?
So all three of these look like they should work based on your second criteria, so the big question is what is #1 supposed to say?
Dammit, typo again. I meant to say "it". Actors should not crit when they use "Attack" and they are equipped with a weapon.

This looks correct to me. You have this on the Attack skill and your actors are still critically hitting? Do you have any notetags on the weapons being used that would overwrite it?
I do not have critical modifiers on weapons or any equipment as of yet. To make sure I have a point of reference, I have two of my test actors have 1000% CRI and only one of them has a weapon equipped. Both are not critting.

I'll do your suggestions in a bit. I'll edit this post if someone doesn't reply right away.

EDIT: Removed the multiplier tag on the rate. Unarmed actor still not critting.
So what is your default Critical Rate Formula as entered in the plugin parameters?
Currently, it's at:
Code:
(base + plus) * rate + flat + (user.luk / 1000)

I tried again with the default parameters for CRI, and still got the same result.
Bump
We're supposed to wait 72 hours before bumping a thread.

I think I found the culprit. When you use the Critical Rate Formula, it doesn't reference the plugin parameter at all, it only uses the formula you specify.

Since you don't give any formula for failing the conditional in your code, it ends up being 0 either way.

Also...
Currently, it's at:
Code:
(base + plus) * rate + flat + (user.luk / 1000)
I don't know where you got those words, but that's invalid and is going to be giving you 0 results also. There's no such thing as "plus" or "flat," I don't see either in the documentation anywhere.

So, anyway, just incorporate it in:
Code:
<Critical Rate Formula>
if (user.isActor() && user.weapons().length!=0)
    rate=0;
else
    rate=(base + bonus) * rate  + (user.luk / 1000);
</Critical Rate Formula>
I don't know where you got those words, but that's invalid and is going to be giving you 0 results also. There's no such thing as "plus" or "flat," I don't see either in the documentation anywhere.
Whoops. I gave the CRI formula from the Extra Param Formula plugin. ^^;;

If you are still curious, the one found in the Critical Control plugin is at default, namely:
Code:
rate = user.cri * (1 - target.cev);

So, anyway, just incorporate it in:
Code:
<Critical Rate Formula>
if (user.isActor() && user.weapons().length!=0)
rate=0;
else
rate=(base + bonus) * rate + (user.luk / 1000);
</Critical Rate Formula>
I've updated my tag accordingly, but I still encountered the same issue. At this time, it appears as such:

Code:
<Critical Rate Formula>
if (user.isActor() && user.weapons().length != 0) {
rate = 0;
else
rate = user.cri * (1 - target.cev);
}
</Critical Rate Formula>
I've updated my tag accordingly, but I still encountered the same issue. At this time, it appears as such:
You did not correctly copy the code I gave you. You put braces after the if until the end of the thing, which means the else is inside of the if statement - it is invalid code syntax there.

If you get rid of the braces I didn't type, and copy the format I provided, it should work.

If statements, for loops, etc. automatically apply to the next single code statement. Braces are only necessary to create a code block if you're doing more than one thing afterward. (and then, of course, you need to put them in the right place 😉 )
If you get rid of the braces I didn't type, and copy the format I provided, it should work.
Properly copied the format. It does work as desired now! Thanks for the patience!

In case you're curious: Yes, the Weapon Unleash half of my plan also worked as desired. This is how I'm making my crits work now.

Original thread: https://forums.rpgmakerweb.com/threads/yep-critical-control-and-0-crit-rate-when-actors-attack-without-equipped-weapons.149351/