Is there a way to target certain enemies in certain rows at once with Yanfly's Row Formation?

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
I've been using Yanfly's Row Formation and I've found myself stuck trying to work out an attack.

Say I have 4 rows to correspond with 4 battlers.
I want to make an attack that checks if battler 1, 2, and 3 are standing in row 1, 2 or 3.
Handy diagram:
⬛⬛⬛⬜
⬛⬛⬛⬜
⬛⬛⬛⬜
⬜⬜⬜⬜
If the above battlers are found standing in that range they will take damage, if they are standing outside they will take no damage.

The problem is I can't quite figure out how do this. I've tried making a for loop but that's only useful for checking battler indexes above 2. I've also tried using the "target enemy row" notetags with Yanfly's Target Core but that doesn't seem to work either.

Is there's a solution to this? I would greatly appreciate it.
 

Papillon

Veteran
Veteran
Joined
Feb 22, 2017
Messages
60
Reaction score
8
First Language
English
Primarily Uses
RMMV
Never mind I worked it out myself. If anyone else finds thread and is looking for an answer.
Add a row state for each row using the plugin's parameters and put this in a damage eval's notebox tags if you're using Yanfly's Skill Core.
Code:
dmg = [YOUR FORMULA HERE]
// Get the target's alive allies.
var members = target.friendsUnit().aliveMembers();
// Loop through each member and ignore the fourth..
for (var i = 0; i < members.length - 1; ++i) {
    // Get current looped member
    var member = members[i];
    // Check if member is in these rows
    if (member.isStateAffected(YOUR STATE ID HERE) || member.isStateAffected(YOUR STATE ID HERE) || member.isStateAffected(YOUR STATE ID HERE)) {
        member.gainHp(-dmg);
    }
}
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)
A friend requested me to do a pfp for his twitch channel, so far he approved one of my sketches, so going to digital now. The style he's looking for is quite different from my usual, hopefully I can get it right... :kaoback:
I am so hyped! A new post update and im anxious to see reactions..eeeeeeee
When a youtuber plays your project or game made by you using MAKERs, you will just be awe struck

Forum statistics

Threads
105,478
Messages
1,014,005
Members
137,117
Latest member
Deli
Top