Targeting a specific Ally

Hi Everyone,

I am using Yanfly Scripts and i would like one of my skill to target only a specific ally.

I know that i have to use the formula <Custom Target Eval> in notetag, but then i am terrible with Javascript and i realy don't know what can come next. I just want this ability to work only on a specific ally. Can it be like actor.(ID) ?

Thanks in advance!
if it is a skill that is designed to always target only the same specific ally (ie. skill only targets actor 1 even when cast by actor 3)
you could have the skill be a self target and all it does is trigger an event while the event does everything on actor 1

however that would still allow you to use the skill even when actor 1 is dead.
Yeah, I think you could do something like (target._actorId === n) where n is the ID of the actor in the database. That should evaluate to either 'true' or 'false' depending on whether the target is indeed that actor. I believe this would make the correct notetag (change 7 to whatever ID you want):
Code:
<Custom Target Eval>
  for (var i = 0; i < allies.aliveMembers().length; i++) {
    var member = allies.aliveMembers()[i];
    if (member._actorId === 7) targets.push(member);
  }
  </Custom Target Eval>

PS - In the future, if you need help writing a notetag for an existing script, "Plugin Support" is the correct forum for it (not "Plugin Requests"). Moving this topic to Plugin Support.
@Wavelength @Tiamat-86 Thank you so much for your answer, i did it in another way. I just put a Passive State to my character and then with Selection Control target if the actor has this specific state or not. It work realy well. I was using it for summoning a monster by a character then be able to buff only him.

Thanks for your time and have a good day!

Original thread: https://forums.rpgmakerweb.com/threads/targeting-a-specific-ally.115786/