“True” random multihit Targeting

Hi,

I’m looking for a code or plugin that will help me replicate how multihit skills work in the persona series.

Basically, this is the scenario:

You’re facing three enemies in combat. You use skill multihit 3. This skill will hit a total of 3 times, but the targets are random. Basically, it could hit enemy a twice and enemy b once. Or it could hit enemy a, b, and c. Or it could hit enemy a 3 times. Basically, three hits are guaranteed, but the targets are always random.

Currently, I’ve tried to do this with the default rpg maker functionality, but even with random repeats and random targets only one target will take the brunt of the damage.

Thank you!!
how have you tried? That should be simply done by selecting "3 random enemies"?

If you have some battleplugins that change the behaviour of the battlesystem, you need to specify this for compatibility.
how have you tried? That should be simply done by selecting "3 random enemies"?

If you have some battleplugins that change the behaviour of the battlesystem, you need to specify this for compatibility.

Using my example, If you select “three random enemies” and put the repeats on three, each enemy will be hit 3 times (for a total of 9 hits).

If you use two random enemies in that instance, two of those enemies would get hit three times( for a total of 6 hits).

I’m looking for 3 hits total across all enemies.

Does that help?


No major plugins that effect the dynamics of the battle systems aside from the Yanfly library and Mog’s Battle HUD.
When you select "3 random foes" and have the repeats on 1, you will see it hit three random foes, exactly like you're looking for.

The behavior you're seeing is because you're using the "Repeats" function; the spell will repeatedly hit the same target 3 times when repeats is set to 3 (then it will move on to another random foe 3 times, etc.).

If you want each proc to hit a different random foe, don't use "Repeats". If you're trying to get beyond the editor's limit of 4 random hits, get Yanfly's Target Core and make use of the <Target: x Random Foes> notetag.
When you select "3 random foes" and have the repeats on 1, you will see it hit three random foes, exactly like you're looking for.

The behavior you're seeing is because you're using the "Repeats" function; the spell will repeatedly hit the same target 3 times when repeats is set to 3 (then it will move on to another random foe 3 times, etc.).

If you want each proc to hit a different random foe, don't use "Repeats". If you're trying to get beyond the editor's limit of 4 random hits, get Yanfly's Target Core and make use of the <Target: x Random Foes> notetag.

The repeats were actually a bad example. I shouldn’t have used them, but was just trying to make a point.

Basically, my only question is if I use the yanfly target core notetag, can the same enemy be hit more than once with a skill proc?

That’s what I’m asking really. Everytime I’ve done this using the default method, it doesn’t work.
The same enemy can be hit, but that is also truly random, as it just selects a random target each time for each hit. So for example, say you have enemies A B and C and the skill is 3 hits. That means there is a 1/3 chance for it to select each enemy, and a 1/27 chance (1/3 * 1/3 * 1/3) chance it will select the same target for all 3. But by definition of truly random the same target can be selected as before.
Everytime I’ve done this using the default method, it doesn’t work.
then you have done something wrong. That is why I asked.
As said above you ONLY need yanfly's plugin if you want more than 4 random hits.

For 1 to 4 random hits you set the scope to the wished-fore number of random hits and keep the repeat at 1. That is actually extremely important because 1 random enemy and 3 repeats would hit the same random enemy three times.

Only if you want the skill to have 5 or more random hits, then you need the plugin because there is no default scope with more than 4 random enemies.

In fact some people have exactly the other problem - since the "4 random enemies" can hit the same enemy multiple times they seek plugins to prevent those multiple hits on the same target, but you are one of those who want multiple hits that are there by default.

Actually - that could be the problem. If you added a plugin that was written exactly to prevent multiple hits on the same enemy, that would explain your problem. And such plugins do exist.
So again, please give a screenshot of your plugin manager to see if we can find a plugin that disables those default multiple hits.
Just because you do not remember installing one such plugin does not mean that it is not included - especially yanfly has the tendency to have his plugins do multiple things that then surprise people who made mistakes configuring them.
The same enemy can be hit, but that is also truly random, as it just selects a random target each time for each hit. So for example, say you have enemies A B and C and the skill is 3 hits. That means there is a 1/3 chance for it to select each enemy, and a 1/27 chance (1/3 * 1/3 * 1/3) chance it will select the same target for all 3. But by definition of truly random the same target can be selected as before.

Thanks! That’s all I needed to know. I’ll do clean sweep of my plugins and see if anything is causing an erratic behavior.

Thanks for the help everyone .
If you don't see anything you can also post a screenshot of the skill that is behaving oddly. Sometimes a 2nd set of eyes spots things you've missed.

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/true-random-multihit-targeting.110284/