Enemy not attacking first turn because of Custom Select Condition

So, I'm using Olivia OTB Battle System (and planning to buy Side Battle UI) and also Yanfly's Target Core/ Selection Control. (and others but i believe the problem is on the interation of those)

I created a state like Healing Link (http://www.yanfly.moe/wiki/Healing_Link_(MV_Plugin_Tips_&_Tricks)). Basically, when the affected creature is healed, whoever put the state on it is healed as well.

The skill that put this state is cast by enemies only. And i used this code to make sure the enemy doesn't put on itself:

<Custom Select Condition>
condition = ( user != target);
</Custom Select Condition>

The problem is that when using this, sometimes one of the enemy just loses its next turn. (Mainly when both enemies are the same, but happens when they are different as well.)

I'll post some screenshots for reference (Enemy, Skill, State)

enemy.png

The enemy that's causing all this is a "Light Slime"


skill.png

The skill, "Healer's Link", with the condition. (When i remove this condition, everything works, but i don't want this skill to target the user)

state.png

The state that heals the origin of the buff.

Can anyone give me a light on this one?
I was having a similar issue.

I used the exact same code for the <Custom Select Condition>.
Code:
<Custom Select Condition>
condition = ( user != target);
</Custom Select Condition>
The enemy would use an attack with this condition every single turn. After some turns (I don't know why), every single time he used this skill, he would make THE ENTIRE PARTY be able to use only skills that can target yourself. Any skill that a party member has, that can't target himself, would be blocked.
However, once you use a skill that targets yourself, this bug disappears, allowing you to use any skill with no issues.

I changed the code to this one:
Code:
<Custom Select Condition>
if (user != target) condition = true;
else condition = false;
</Custom Select Condition>
I was not able to replicate the bug. If I see the bug happened again even with this code, then I come back here and warn you.
I was having a similar issue.
Just to mention it, we're not supposed to necro-post in support threads. This thread is almost three years old and the poster hasn't been on the site since August of 2020. They pretty definitely aren't going to see your response.

It also is not the same problem. The OP appears to have had a logical error where the Battle AI Core notetags were saying to use this skill but the Select Condition was forbidding it.

The bug you're describing with the entire party's selection being changed has nothing to do with what this thread was talking about.

I used the exact same code for the <Custom Select Condition>.
Code:
<Custom Select Condition>
condition = ( user != target);
</Custom Select Condition>
This is fine (although the parentheses are unnecessary).

The enemy would use an attack with this condition every single turn. After some turns (I don't know why), every single time he used this skill, he would make THE ENTIRE PARTY be able to use only skills that can target yourself. Any skill that a party member has, that can't target himself, would be blocked.
However, once you use a skill that targets yourself, this bug disappears, allowing you to use any skill with no issues.
This all sounds very weird and would lead me to look at things like the order of your Yanfly plugins to be causing random glitches. I don't see any reason a select condition on one skill would have any effect on other skills.

I changed the code to this one:
Code:
<Custom Select Condition>
if (user != target) condition = true;
else condition = false;
</Custom Select Condition>
This isn't any different from your original condition, code-wise. It's written out in a longer way, but it won't produce any different results.
Just to mention it, we're not supposed to necro-post in support threads. This thread is almost three years old and the poster hasn't been on the site since August of 2020. They pretty definitely aren't going to see your response.
I'm sorry, but since no one has helped around here, if I give a solution, I could help other people that face a similar issue. I guess I should have created a new thread then, and referenced this one.
The OP appears to have had a logical error where the Battle AI Core notetags were saying to use this skill but the Select Condition was forbidding it.
But this sounds like my issue. The AI can't use the skill, just like I could not use the skills.
In my case, the enemy using this condition would interfere the skills from my party members. In his case, it seems like one enemy using it is also interfering the skills of other enemies, since these enemies just miss an entire turn (maybe many of their skills are being blocked like it happend to me).

This all sounds very weird and would lead me to look at things like the order of your Yanfly plugins to be causing random glitches.
The order is correct.
I don't see any reason a select condition on one skill would have any effect on other skills.
I see a reason for it and I explained why.
The enemy that used a skill with that condition (user != target) would block all my party skills that can't target the user. Any skill that targets the user is able to be used, but the ones that don't can't be used. That would be a huge coincidence.
Not only that, the moment I use a skill that can target the user, the bug would disappear. So it seems to me like using another skill would "overwrite" the Select Condition that bugged and interfered all skills.

This isn't any different from your original condition, code-wise. It's written out in a longer way, but it won't produce any different results.
Yeah I know, but maybe there is some kind of issue with the "condition = (user != target)", since it is written using a different "type of logic notation" from my code. Since I'm using a if, maybe it is not bugging stuff.
I tried to replicate the bug with this new code and I could not. But yeah, maybe my code did not fix it, and my issue is not the same as the one from this thread.
But this sounds like my issue. The AI can't use the skill, just like I could not use the skills.
I don't see how it's the same. With the AI core, there is an observable reason the skill couldn't be used - if the enemy was the only one in combat that didn't have state 34, the AI core would be telling them to use skill 721 but the selection control on skill 721 would be forbidding it from executing.

In your case, nothing in the selection control of an enemy skill should have any effect on another skill. Never mind another skill from another battler. Never mind your entire party somehow.

In my case, the enemy using this condition would interfere the skills from my party members. In his case, it seems like one enemy using it is also interfering the skills of other enemies, since these enemies just miss an entire turn
The original post is slightly unclear, but I read it as the enemy with this skill loses a turn. Which fits into my theory above.

I see a reason for it and I explained why.
I understand what you're saying and I'm not discounting that something strange is happening in your game.

maybe there is some kind of issue with the "condition = (user != target)", since it is written using a different "type of logic notation" from my code. Since I'm using a if, maybe it is not bugging stuff.
I can't see any way that's a thing. In JavaScript syntax those are completely equivalent. I can't think of any possible values for user and target that could cause those two conditionals to evaluate differently.

So it seems to me like using another skill would "overwrite" the Select Condition that bugged and interfered all skills.
If you can construct something in a demo project that reliably duplicates the bug under specific circumstances, I'd welcome you to post a thread about it with a download link - I'm personally interested in cleaning up the Yanfly library.
Ok. I will try to investigate it and maybe I create a thread depending on what I find out.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-not-attacking-first-turn-because-of-custom-select-condition.121634/