[SOLVED] Aiming each ally but me

Status
Not open for further replies.

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
Hi everyone,

I'm trying to create a boost for a mage that will add an state to a member of the party, then it calls a common event that check how many party members is affected with it an add it to the caster (the more they have the state, stronger is the applied one).

My problem is that I select myself when I target "any ally", and the concept of the state is to be able to select each of my allies (one by application) but me.

I know VS has a JS command that can be used to custom for this, but I don't know (or have any reference) of how to edit to delete the user from the selection when it is "any ally".

Any ideas?
 

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
I found the JS tag, it's from VS Battle Core:
JavaScript:
<JS Targets>
 code
 code
 targets = [code];
</JS Targets>

- Used for: Skill, Item Notetags
- The 'targets' variable is an array that is returned to be used as a
  container for all the valid action targets.
- Replace 'code' with JavaScript code to determine valid targets.
But I don't know how to determine "each ally but self".

<Target: All Allies But User> exists, but (I need to check it out) that means all at the same time, and it's not what I'm looking for.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,050
Reaction score
1,479
First Language
EN
Primarily Uses
RMMZ
You could try this (untested):
Code:
<JS Targets>
targets = $gameParty.battleMembers().filter(m => m !== user);
</JS Targets>
This says "get all party members in battle who aren't user".
(I'm assuming user is a valid reference here, not sure. :kaoslp:)
 

prototyper

Warper
Member
Joined
Oct 27, 2020
Messages
3
Reaction score
2
First Language
English
Primarily Uses
RMMZ
You could try this (untested):
Code:
<JS Targets>
targets = $gameParty.battleMembers().filter(m => m !== user);
</JS Targets>
This says "get all party members in battle who aren't user".
(I'm assuming user is a valid reference here, not sure. :kaoslp:)
Presumably you only want living party members. So I would modify it to something like

Code:
<JS Targets>
targets = $gameParty.aliveMembers().filter(m => m !== user);
</JS Targets>
That said, is "user" defined? I have no idea how these plugins work. If not, this may work as well.

Code:
<JS Targets>
targets = $gameParty.aliveMembers().filter(m => m.actor().id !== BattleManager.actor().actor().id);
</JS Targets>
 
Last edited:

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
You could try this (untested):
Code:
<JS Targets>
targets = $gameParty.battleMembers().filter(m => m !== user);
</JS Targets>
This says "get all party members in battle who aren't user".
(I'm assuming user is a valid reference here, not sure. :kaoslp:)
Hi caethyril,
I tried it and I still can select "myself" to use the power, what is rare is that it's applied to my party.

As this skill is only used by a character, Can I use the ID of the character instead of "user"?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,050
Reaction score
1,479
First Language
EN
Primarily Uses
RMMZ
Presumably you only want living party members.
Yes, good thinking! :)

I tried it and I still can select "myself" to use the power, what is rare is that it's applied to my party.
OK I've just tested the plugin + notetag and can confirm: it seems it gets checked after the skill has been selected for use, which means it doesn't affect target selection (like YEP Target Core vs Selection Control for RMMV). You want to select 1 ally to target, but not be able to select the user, correct? I had another quick look through the VisuStella plugin options but didn't find anything to restrict selection...maybe I'm missing something? :kaoslp:

I have a plugin called Cae_OnUseEffects that offers a <target filter> notetag. This lets you specify additional conditions for battlers to be selectable targets. For your skill you could try:
Code:
<target filter: return target !== user;>
I.e. select 1 Ally (skill scope) who isn't the user (notetag). I don't know if it will work with VisuStella's stuff, but you could try loading my plugin after VisuStella's, save your project, and test. In case you're interested, you can find Cae_OnUseEffects here (Google Drive link), or on my plugin release thread:
 

miyanke

Veteran
Veteran
Joined
Dec 2, 2015
Messages
73
Reaction score
12
First Language
Spanish
Primarily Uses
RMMZ
Yes, good thinking! :)


OK I've just tested the plugin + notetag and can confirm: it seems it gets checked after the skill has been selected for use, which means it doesn't affect target selection (like YEP Target Core vs Selection Control for RMMV). You want to select 1 ally to target, but not be able to select the user, correct? I had another quick look through the VisuStella plugin options but didn't find anything to restrict selection...maybe I'm missing something? :kaoslp:

I have a plugin called Cae_OnUseEffects that offers a <target filter> notetag. This lets you specify additional conditions for battlers to be selectable targets. For your skill you could try:
Code:
<target filter: return target !== user;>
I.e. select 1 Ally (skill scope) who isn't the user (notetag). I don't know if it will work with VisuStella's stuff, but you could try loading my plugin after VisuStella's, save your project, and test. In case you're interested, you can find Cae_OnUseEffects here (Google Drive link), or on my plugin release thread:
YEAH!!!
That works!!

I'm sorry to say that I didn't know your Pluggins but I've been reading some of them and they will help me A LOT.

Thank you tho for all your effort.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,787
Reaction score
5,209
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Oh no. That moment when you try to fix something you modified in your game, like, a year ago but didn't want to fix then, and you now have no idea what you even did. Me right now, trying to figure out why my gold window is over stretched?
LittlePIGGY wrote on atreyoray's profile.
Where are you TT^TT
We need ARP_InGameManual for MZ
Oh my gosh. Thank you, Macy's! Thank you so much! You have made me very happy!
Happy Thanksgiving everyone! What are you thankful for? I'm thankful that I no longer have PTSD, and that I get to enjoy a good meal with my mom and stepdad! It might not be the same as before COVID, but at least I still get to enjoy the holiday!

Forum statistics

Threads
105,550
Messages
1,014,568
Members
137,225
Latest member
Eryndor
Top