Need help setting up correct tag - Yanfly's Target Manager

I have a skill that attack random x number of enemies (for my case, x =2). However; random here means hitting any enemy for x times. It can be either one hit per each enemy or the same enemy taking 2 hits while my purpose is to have the skill randomly hit 2 enemies, one hit for each enemy only. Moreover, if there is only one enemy on screen and use the skill, the enemy should only take one hit rather than 2 by default.

Have seen someone recommending Yanfly's Target Manager for more control on targeting but I can't seem to write a correct note tag to make it work like what I want.

Can anybody tell me how to write a correct note tag?

Here is the script's source: https://github.com/A...rget_Manager.rb
I tested it not by myself yet, but I also want to use Yanfly's Target Manager. What you want to achieve could be done with the AddOn for the target manager: Area of Effect

I didn't tested the AoE script by myself too, but as I understand the instructions right, you can set up your skill to have an area of effect for 2 enemies and then they get hit only once. and if there is only one enemy it would get hit only once.

I recommend you to look at this script and try it. =)
There is no tag that I know of to do what you want with that script. The reason is, once RPG Maker is told to do 2 random attacks, it has to find two targets. Therefore, it has to attack the same enemy 2x if there is only one enemy present.

What you want would require a different script altogether, and it would have to be one that overwrites how target selection is done completely in the engine I'm afraid.
I tested it not by myself yet, but I also want to use Yanfly's Target Manager. What you want to achieve could be done with the AddOn for the target manager: Area of Effect

I didn't tested the AoE script by myself too, but as I understand the instructions right, you can set up your skill to have an area of effect for 2 enemies and then they get hit only once. and if there is only one enemy it would get hit only once.

I recommend you to look at this script and try it. =)
I think the add-on will be additional work for my project as I need to design well for enemy's position for each troop. Anyway thank you for your reply and recommendation.

There is no tag that I know of to do what you want with that script. The reason is, once RPG Maker is told to do 2 random attacks, it has to find two targets. Therefore, it has to attack the same enemy 2x if there is only one enemy present.

What you want would require a different script altogether, and it would have to be one that overwrites how target selection is done completely in the engine I'm afraid.
Too bad.. I have been searching for a script that serves what I want but no luck..

Thanks anyway!

This topic can be locked.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-setting-up-correct-tag-yanflys-target-manager.38190/