MV How to write custom select conditions in YEP_X_SelectionControl ?

So, I want to create 2 conditions in the battle where, the first condition is that a character with actor number 11 or class 11 cannot use items for himself but can use for all party members.

Next,The second is conditions for all parties that they can't give items to characters with actor number 11 or class 11. After I search there is a plugin called YEP_X_SelectionControl. But I'm quite confused how to use it. Is the code in my notetags correct?

<Custom Select Condition>
if ($gameActor.actor(actorId)._classId === 11)
{
Not User = true;
}
else
{
condition = false;
}
</Custom Select Condition>

I've moved this thread to Plugin Support. Thank you.

Suggestions (untested):
  1. Selection is OK unless actor ID 11 or class ID 11 is targetting themselves:

    <Custom Select Condition> condition = true; if (user.isActor() && user === target) { if (user.actorId() === 11 || user.isClass($dataClasses[11])) { condition = false; } } </Custom Select Condition>

  2. Selection is OK unless the target is actor ID 11 or class ID 11:

    <Custom Select Condition> condition = true; if (target.isActor()) { if (target.actorId() === 11 || target.isClass($dataClasses[11])) { condition = false } } </Custom Select Condition>
Moved to: Plugin Support Suggestions (untested):
  1. Selection is OK unless actor ID 11 or class ID 11 is targetting themselves:

    <Custom Select Condition> condition = true; if (user.isActor() && user === target) { if (user.actorId() === 11 || user.isClass($dataClasses[11])) { condition = false; } } </Custom Select Condition>


  2. Selection is OK unless the target is actor ID 11 or class ID 11:

    <Custom Select Condition> condition = true; if (target.isActor()) { if (target.actorId() === 11 || target.isClass($dataClasses[11])) { condition = false } } </Custom Select Condition>


I've tried both and it works. But there is 1 problem. The item can also be given to enemies who should only be party members.
I've tried both and it works. But there is 1 problem. The item can also be given to enemies who should only be party members.
Have you intentionally allowed that scope to change? By default, if you set the scope of the item to be 1 Ally, you can't target enemies.

Plugins like Yanfly's Target Core allow you to change that behavior if you selected it in the plugin parameters, which you should know. But that should be happening for all of your items/skills, then, not just this one.

You can force it by changing the first line of code in each of caethyril's notetags:
Code:
condition=target.isActor();
Have you intentionally allowed that scope to change? By default, if you set the scope of the item to be 1 Ally, you can't target enemies.

Plugins like Yanfly's Target Core allow you to change that behavior if you selected it in the plugin parameters, which you should know. But that should be happening for all of your items/skills, then, not just this one.

You can force it by changing the first line of code in each of caethyril's notetags:
Code:
condition=target.isActor();

No, i didn't change anything. All i do is just turn on YEP_TargetCore and YEP_X_SelectionControl and put those notetags in my item.

Btw, Both script code works exactly as i want. Thank You very much 😀

Original thread: https://forums.rpgmakerweb.com/threads/how-to-write-custom-select-conditions-in-yep_x_selectioncontrol.152116/