A little bug with Yanfly's Skill Restriction Script?

So I was using the Skill Restriction Script perfectly fine so far, but I encounter a problem with the <restrict eval>
In Yanfly's page he himself show's an example of more than 1 requeriment for a skill to be restricted using the "&&" command.
1658606587013.png


But after trying out, I realized that the && doesn't care if the 2 of them are true, just one is required to the skill to be avalible. So basically (as long as I'm aware) you don't have a method to check 2 or more conditions to the skill to be restricted.
I tried it with something some simple as HP and MP as the self example yanfly showed. As long as 1 of these 2 are correct, the skill can be activated. Is maybe there another method to ask to all the conditions to be true besides the "&&"?
If that's the example then it should work, but lets make it more code friendly. Perhaps something is not properly evaluating the entire line.
Try three different ways and see if one works.
(self.tp < 50) && (self.mp < 200)
((self.tp < 50) && (self.mp < 200))
(self.tp < 50 && self.mp < 200)
If that's the example then it should work, but lets make it more code friendly. Perhaps something is not properly evaluating the entire line.
Try three different ways and see if one works.
(self.tp < 50) && (self.mp < 200)
((self.tp < 50) && (self.mp < 200))
(self.tp < 50 && self.mp < 200)
Just tried it and is still not working properly. What I didn't tried out yet is in a blank project. I don't think is possible, but maybe some other script could be giving some error?

EDIT: SOLVED IT, for some odd reason, the && works as an "OR", so I tried reverse engineering and used the "OR" ( || ) to check for the condition and... it works.

So for the Skill Restriction Script:
&& is or
|| is and
I know this is an older topic, and already solved, but maybe this will help the OP understand why the condition he wanted didn't work.

As long as 1 of these 2 are correct, the skill can be activated.
That means the script is working as intended.
Although, you worded that in an inverse way, because it should be:
"As long as 1 of these 2 are not correct, the skill can be activated."

&& means and in coding, you already noted that.
The restrict eval note-tag you used will make the skill/item disabled if the code you entered there returns true.

In your original example (with the && used), the skill will only get disabled if both of those are true.
This means if only one of them are true, the skill will not get disabled.

In the || version, if only one of those conditions is true, the skill will get disabled, because || means that if any of the 2 conditions returns true, the result will be true as well.

Remember, this note-tag is a restriction condition, not an enable condition.
I know this is an older topic, and already solved, but maybe this will help the OP understand why the condition he wanted didn't work.


That means the script is working as intended.
Although, you worded that in an inverse way, because it should be:
"As long as 1 of these 2 are not correct, the skill can be activated."

&& means and in coding, you already noted that.
The restrict eval note-tag you used will make the skill/item disabled if the code you entered there returns true.

In your original example (with the && used), the skill will only get disabled if both of those are true.
This means if only one of them are true, the skill will not get disabled.

In the || version, if only one of those conditions is true, the skill will get disabled, because || means that if any of the 2 conditions returns true, the result will be true as well.

Remember, this note-tag is a restriction condition, not an enable condition.
yeah, hahahaha after scratching my head enough I figured that out. It's a shame yanfly didn't make it clear in his own image-example as it shows: tp && mp and makes you think it depends on both stats being the same.

Original thread: https://forums.rpgmakerweb.com/threads/a-little-bug-with-yanflys-skill-restriction-script.149750/