YEP Target Core and Selection Control Bug - <Custom Select Condition> Blocks Party Skills

So I started this discussion here on this old thread, but it is against the rules, so I created a new thread instead.

The plugins I'm using are from Yanfly:
Target Core
Selection Control, and extension from Target Core
Battle AI Core
Row Formation
Instant Cast

- The problem:
I have a <Custom Select Condition> from an enemy that is bugging my party.
The <Custom Select Condition> blocks the use of some skills from my party.

- Part 1: The Skill and the <Custom Select Condition> setup
An enemy has a skill that Targets Everybody:
Code:
<Target: Everybody>
AND this skill Targets Everybody excepts the user, using the following code:
Code:
<Custom Select Condition>
if (user != target) condition = true;
else condition = false;
</Custom Select Condition>
If you remove the <Target: Everybody> the bug still happens. Only removing the <Custom Select Condition> that makes the bug not happen.

Here is the skill:
imagem_2023-03-02_100022609.png


- Part 2: How <Custom Select Condition> affects the party
I am using Battle AI Core without the Dynamic Actions options. This means that the AI decides to use a skill at the beggining of a turn, before I even select any skill to use.
I changed the AI of this enemy to ALWAYS use this skill, so I can replicate the bug.

When it is the turn for the enemy to use the bugged skill, the skill blocks all skills from my party that can't target the user. Not only that, it only happens when the enemy is the ONLY ENEMY in combat. If there are more enemies on the field, the bug DOES NOT HAPPEN.
Here are some skills that are blocked because they cannot target the user:
imagem_2023-03-02_100748010.png


However, any skill that CAN target the user are available for use, as you can see here:
imagem_2023-03-02_100924507.png


- Part 3: Choosing a Skill that Selects a Row crashes the game.
I am also using Row Formation!
So what happens is that any skill that Targets a Row will crash the game. The moment I choose a Skill that target a Row, right before selecting a Row, crashes the game.
This is the code for my Area Heal I skill:
Code:
<Target: Ally Row>
Code:
<Custom Select Condition>
if (target.isStateAffected(1)) condition = false;
else condition = true;
</Custom Select Condition>
I removed the <Custom Select Condition> from the Area Heal I skill and the crash still happened. However, if I remove the <Target: Ally Row>, the bug does not happen. So I assume the issue is with the Row Formation Target.

Here is the crash:
imagem_2023-03-02_102119659.png

You can see more crash info at the pinned images.
(first image and second image are from Target Core, and third is from Battle Engine Core).

- Part 4: Removing the bug with a Skill that can target the user and does not use the Row Target
So I was really luck to discover this...
I have a <Instant Cast> skill, which means it does not cost a turn.
This skill can target the user, and does not use Row Target.

Once I use this instant cast skill, the bug disappears, allowing me to use any skill with no issues.
What I'm saying here is that once I use a Skill that can target the user, it removes the bug (the Instant Cast was mentioned on this post just to show the method I used to make this discovery, the Instant Cast has no effect in this situation).
However, on the next turn, since the AI of the enemy is programmed to always use the skill that is bugged, the bug appears again.

- Part 5: The bug and its relation with Row Formation
I don't think Row Formation has anything to do with the bug. I mentioned it because it crashes, allowing us to see some extra info from the plugins.

(the plugins are in order).

Any ideias what the issue is?
I just spent 1 hours writting this I'm even a bit dizzy lol. Let me know if I need to give more info >.<
Do you have a little demo project that reliably duplicates these bugs you can link a download for?

That would allow us to test it out without having to recreate all of your skills and code on our own, and to see if there's any mistake in your setup.

Are you using the newest version of the MV core scripts (1.6.1 or .2), and the newest version of all the Yanfly plugins? Have you checked the order of the Yanfly plugins against the Yanfly Engine Web site?
So, at the demo, the skill that targets with Row Formation does not make the demo crash...
But the issue of the targeting and blocking skills is still there.
As I was trying the demo, I realized changing Rows can fix the bug too. So I turned off Row Formation, and the bug is fixed. So the issue is there with Row interacting with Target and Selection Control.
I have a Mem_RowFormation, but removing it does not change anything. I left it there though, and it is deactivated.

Just go to troops, fight it. The character has the skills. The Recover MP skill will "fix" the bug (or changing rows).

https://www.dropbox.com/s/aggdlw3kh89rexo/Project1.zip?dl=0

(I think the plugins are all updated. If not, then I need to buy Yanfly and I dont have the money for that. I got them before it was paid)
(I think the plugins are all updated. If not, then I need to buy Yanfly and I dont have the money for that. I got them before it was paid)
I think this is overwhelmingly likely to be your problem. Older versions of the plugins:
- are not compatible with the newest version of MV, which could cause the problems by itself
and
- are likely to have bugs fixed in newer versions

All of the plugins have had newer versions released since they became paid products, as that happened before the last updates to MV.

Also, you should check your demo - have the project files and all notetags/database entries, etc., but do not include any plugins you're prohibited from distributing (Yanfly's terms of use forbid that).

Anyone who wants to test it and owns those plugins can drop in their own copies. But that won't help if your issue is due to version mismatch, as I strongly suspect it is.
Ok... I will see what I'm going to do. I deleted the demo...
If you have yanfly plugins, maybe you could replace my files and see if works?
If you deleted the entire demo, not just the plugins folder, then we don't have anything to look at.

I wrote back as soon as you said you were using outdated versions of everything, because that's not a viable situation for testing and troubleshooting.
Ohh ok, I'm sending the demo again without the plugins.
I wonder if it will work with just...
Core
Battle Engine Core
Skill Core
Instant Cast
Row Formation
Target Core
Selection Control
Battle AI is not needed but would need to make the enemy use the proper skill
Maybe Damage Core too.
https://www.dropbox.com/s/1jy4ryn5re5pjsz/Project1.zip?dl=0

Original thread: https://forums.rpgmakerweb.com/threads/yep-target-core-and-selection-control-bug-custom-select-condition-blocks-party-skills.155444/