Random Panda

Regular
Regular
Joined
May 3, 2016
Messages
133
Reaction score
34
First Language
English
Primarily Uses
RMMV
Hi All,

I think this might be a simple one. But I am looking for a condition to check for a specific skill. I have a skill that needs 2 or more of the same enemy to activate and I got that working with "Troop Alive Members > 1", but the issue I run into is if one enemy of that kind is alive with a different enemy it will still try and do that skill. What I need to check for is if more than 1 of the same enemy ID is alive.

Does anyone know if that is possible with an Eval, and if so, what would be the eval?
I was thinking something along the likes of:
alive enemyId(XX) > 1 : Skill XX, Highest HP%

But, you know, actually correct.

As always, any help is greatly appreciated.
 

eomereolsson

Regular
Regular
Joined
Sep 29, 2021
Messages
582
Reaction score
508
First Language
German
Primarily Uses
RMMV
I would try something along those lines in the EVAL (sorry, I am not at home, so I can't actually test it):
let result=false; $gameTroop.aliveMembers().forEach(m => {if (user != m && user.enemyId() == m.enemyId()) result = true;}); result;
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
10,986
Reaction score
8,870
First Language
English
Primarily Uses
RMMV
Just to offer a slightly shorter option (not any better, as far as I know!):
Code:
$gameTroop.aliveMembers().filter(member => member.enemyId()==user.enemyId()).length>1

Both of these solutions are presuming that the enemy you want two of is the enemy using the skill. If that's not the case (the boss needs two henchmen to use a thing), then replace user.enemyId() with the ID of the desired enemy.
 

Random Panda

Regular
Regular
Joined
May 3, 2016
Messages
133
Reaction score
34
First Language
English
Primarily Uses
RMMV
Thank you to both of you! That got me to what I was looking for!
 

Latest Threads

Latest Posts

Latest Profile Posts

New character incoming!

Compilation of some of the last few days onto my testing map.
Finished all the tools! Really happy with how they turned out. For clarification, when using the portal tool, if you spawn into a wall, it kills ya.
I've figured out how to implement abilities into Snapdrake. My fav is prolly Hell or High Water, considering its essentially "go big or go home" the ability.

Forum statistics

Threads
134,730
Messages
1,250,163
Members
177,487
Latest member
Forestblue
Top