MV Trying to make an attracting skill with Yanfly's Area of Effect

To go into a bit more detail, I'm trying to make it so that enemies caught in the area of effect will move closer to the point where the enemy that was selected was located. the only issue is that trying to use the move action sequence command to send the enemies to the "target" only sends them to themselves, with the result being that they just move upward a bit.

I attempted to use "move target: point" and having the x y coordinates be $gameTroop.members()[Index]._screenX and $gameTroop.members()[Index]._screenY but even after extensive googling, I couldn't find any result that worked. the game always crashed no matter what method I tried to use to obtain the index of the originally selected enemy.

I may be missing something obvious but nothing I've tried so far has worked so I was hoping someone on here would be able to provide some sort of solution.
I attempted to use "move target: point" and having the x y coordinates be $gameTroop.members()[Index]._screenX and $gameTroop.members()[Index]._screenY
Index is not a word that's going to mean anything there. If you type that, it's referencing a variable with that name, and there is none.

Additionally, you can't do that. The syntax in the plugin instructions says point is an integer value. As a rule in plugins (and action sequence commands), you can't just substitute JavaScript unless it tells you that a parameter accepts it.

You should be able to at least make progress by doing something like
Code:
move enemies: target, center

But I think you're going to have to code the whole thing, using the eval command and the Action Sequence loop extension:

Edit: I haven't really used the Area of Effect, so the above would just move all enemies, not only those in the AoE. I assume, for purposes of coding it, it simply adds everything in the AoE to the targets array.
Index is not a word that's going to mean anything there. If you type that, it's referencing a variable with that name, and there is none.

Additionally, you can't do that. The syntax in the plugin instructions says point is an integer value. As a rule in plugins (and action sequence commands), you can't just substitute JavaScript unless it tells you that a parameter accepts it.

You should be able to at least make progress by doing something like
Code:
move enemies: target, center

But I think you're going to have to code the whole thing, using the eval command and the Action Sequence loop extension:

Edit: I haven't really used the Area of Effect, so the above would just move all enemies, not only those in the AoE. I assume, for purposes of coding it, it simply adds everything in the AoE to the targets array.

I should've specified this the 'index' in $gameTroop.members()[Index]
was meant to be a stand-in for the actual number in question, not the actual input for the index value.

also I'm fairly sure using javascript in move point works because I've gotten it to work with my "move" skill, with MOVE user: POINT, $gameVariables.value(3), $gameVariables.value(4), 20 with both of those variables being set in a common event that is called just before this move point.
You're right - it's undocumented, but those fields are run through an eval().

So you should be able to use BattleManager._targets[0] to refer to the enemy you actually selected.
it took some tweaking but this worked perfectly!
Thank you!

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.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-an-attracting-skill-with-yanflys-area-of-effect.169864/