[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,072
Reaction score
1,493
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,072
Reaction score
1,493
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,829
Reaction score
5,221
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

grief... lol... I keep seeing request for MZ versions of MV plugins. this is why I haven't moved over and just MZ for my MV project.
Egg-sitting minigame is coming along nicely. Are you a bad enough dino to keep all these raptor eggs warm?

I forgot to post the animated version of the previous map I was working on. I'm still arguing with myself on if I like the stark blue ground better than the undergrowth ground used on the waterfall map. Hmm...
now that fmod is free for indie(<200k revenue), it would be interesting to see someone add fmod support for rpg maker
Can't say I can't promise progress on a project just yet. But I can say I had fun databasing tonight. :)

Forum statistics

Threads
105,802
Messages
1,016,578
Members
137,496
Latest member
sulthorne
Top