I'm working on a script that splits Slimes if they are hit by a certain attack. For single target attacks, it's simple enough, I'm just putting this in the notetags for the weapon or skill that makes the Slimes split. In Post-Damage Eval in Yanfly's Action Sequences so it only runs on slimes that actually get hit by the attack.
Which just checks which slime was hit, then runs the event that splits the according slime.
However I'm hung up on how to implement it for multi-target attacks. Basically I want the script to check which slimes were hit by the attack (as opposed to evading it), and runs the events only for those targets that were damaged. b.index isn't going to cut it since that will just return a single number, and I don't know how to get it to return the indexes of only the damaged slimes.
Code:
$gameVariables.setValue(23, b.index());
$gameTemp.reserveCommonEvent(13);
Which just checks which slime was hit, then runs the event that splits the according slime.
However I'm hung up on how to implement it for multi-target attacks. Basically I want the script to check which slimes were hit by the attack (as opposed to evading it), and runs the events only for those targets that were damaged. b.index isn't going to cut it since that will just return a single number, and I don't know how to get it to return the indexes of only the damaged slimes.