Targeting a specific Ally

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
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!
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
540
Reaction score
219
First Language
english
Primarily Uses
RMMV
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,604
Reaction score
5,069
First Language
English
Primarily Uses
RMVXA
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.
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
@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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

YES! officially released my games soundtrack on Itunes, Spotify, and Amazon..... kinda cool!

Another old age version of Reid. Trying out different style.
Hey everyone! Not sure how many people know about Cafofo Music on Itch.io, but I highly recommend their Sound Effects! It is amazing quality AND quantity and best of all, they are having a 50% sale! I can't express how much I love sales.
Wow.... My last map GIF got 47 likes, 16 retweet and 2,105 views on Twitter in 24 hours. My game thread here's only got 3k views in 6-7 months. I guess building my Twitter was insanely worth it. :LZSexcite:

Forum statistics

Threads
105,593
Messages
1,014,875
Members
137,264
Latest member
ZeoValinferno
Top