[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,117
Reaction score
1,525
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,117
Reaction score
1,525
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,867
Reaction score
5,240
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 Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top