[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,052
Reaction score
1,481
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,052
Reaction score
1,481
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

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,555
Messages
1,014,620
Members
137,231
Latest member
anjing_gila
Top