MZ Using Visustella for Random Repeat Attacks

Hello all! After my last query here, I got around getting some of the Visustella plugins and man, things have been going smoothly! But I found a little roadblock once again...

I've read in a past thread that you can use Custom Action Sequence to make random repeat attacks (say, "shoot your target between 2-5 times") but either I'm too dense to understand the process or I'm missing something. I've tried the Repeat Hits notetag with the Math.randomInt and they don't work and I don't see anything in the plugin commands that can be randomized. Any insight will be appreciated! <3

Also apologies if this is misplaced! Lmk if I need to revisit that thread or move this elsewhere!
Put in your action sequence control variable random and loop your attack, break loop depending on that variable.
EDIT: count inside loops with another variable the times and compare to the random roll
Oooh, I see! But I'm sorry I'm having some difficulty understanding the second part, using another variable to count the loops and compare against the roll... Could you go into a bit more detail?
In the loop you add +1 to a variable X to count how many times the loop has run (set the variable to 0 before the loop). Then you compare it to your random roll variable to check when to break the loop. Like conditional:
if variable X is bigger or equal to the random roll variable -> break loop
Mmmm... This is what I have, but whenever I'm playtesting (I go into the game, not the Troop battle test) it freezes once it delivers the first hit.
1742923921615.png
Your break loop is outside of the loop (under the Repeat Above), so your loop just keeps running indefinitely.

(Also, you don't need the If variable 1 >= 1, because you set it to 1-5, so the condition is always true. And I wouldn't use switches or variables in the 1-10 range, because many times plugins use those...unless you've checked that no plugin is using those).

EDIT: And if you want it to look good, you need to add more action sequence commands in the loop.

EDIT2: And the check isn't "if variable 2 == 5", it should be "if variable 2 == variable 1"
Okay this is what I got, it doesn't freeze the game anymore but it only seems to do 1 hit.
1742935632201.png

I didn't see that any other plugin was using the variables I had in the first place but I changed them just to be safe. I'll go about prettying the sequence up once I know I can get it working lol
Could you show the Skill entry?

Perhaps try adding a WAIT of 10 frames or so within the loop. Just checked my own action sequences but I never have two MECH: Action Effect without a wait in between.

You can also check like this if it is counting properly (since user variables are globally available, there is always a possibility it is being used by another event).
1742962607556.png
Yeah, show screenshots of the skill and other stuff (without cropping).

I tested it with the loop and without any waits and it seems to work fine and all the damage numbers pop like normal on top of each other.
Sorry! I crop because I think I read somewhere there's a limit to image size? But here's the skill page
1742998430541.png

I also ran the show text command like Dinosaur said, and noticed that it returns 0 for both variables
1742998887123.png
Put in your skill notes the notetag <Custom Action Sequence>

EDIT: don't know why you get a variable value of 0 when you set it to 1-5 though, as the common event would run even if it's not designated as an action sequence (did you check the new variables 39 and 40, or just copy what Canned Dinosaur posted?)
Okay, I'm an idiot, I didn't change the \V to actually match the variables! Sorry!!

But yeah, putting the notetag seemed to do the trick! Gosh... I feel silly that it was such an easy fix... I will have to go through the tutorials all over again

1743001178192.png
1743001182893.png
Cool.

If you don't put the notetag, it just runs the skill as "normal", so it does the hit and then runs the common event. However, trying to run the BC plugin command action effect at that point, I guess it can't reference the action anymore and does nothing (that's why you only saw the one normal hit). But in the middle of the action sequence you can use the command.
Mmmm, I see... I'll keep fiddling with this and keep learning more. Thank you so much for being so patient with me <3

Original thread: https://forums.rpgmakerweb.com/threads/using-visustella-for-random-repeat-attacks.176535/