[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,069
Reaction score
1,488
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,069
Reaction score
1,488
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,826
Reaction score
5,218
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

does there exist a word for a state of being that is between "living" and (not "dead", but ...) "not living" .... does that make sense, or do I just sound like Im high for something :[ ?
Hope you are all fine today~
Moderators, you must have so much patience to be able to deal with everything. I mod in a server of sorts and today we just got a message, which, despite it's helpful constructive criticism, basically stated that all of the mods were jerks and that was the only reason our server was unlikeable. So, thank you, for having patience. You are appreciated! :kaoluv:
Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......

Forum statistics

Threads
105,740
Messages
1,016,009
Members
137,425
Latest member
Mirla21
Top