SOLVED: Lunatic Passive State: Force Action if Critical Hit is landed?

So in order to make battles seem a bit more action packed, I've been trying to get some follow-up attack to trigger to give the sense of characters pulling off combos. Example: Character uses a normal attack, lands a critical hit -> follow-up skill would be immediately used (Skill ID #4 in the database, for this example.) Character uses normal attack, no Crit lands -> nothing happens, moves onto the next turn/action in the battle queue. I tried tweaking Yanfly's Dual Cast code to just check and see if the attack was Physical instead of checking to see if it was both a Skill AND Magical, but I just can't seem to get it to trigger, so I'm not sure it's what I should be using as a base. I can get the animation to play if a Critical Hit lands via:

<Custom Confirm Effect>

if (target.result().critical) {

user.startAnimation(151, user.isActor());

}

</Custom Confirm Effect>

But after that, I just can't seem to find the right direction to go. Does anyone have any thoughts? The help would be much appreciated ^^;
I think this script is what you want. It calls a common event on critical hit. Just put "force action" in the common event you link it to. I think youd also be able to do different common events for each charecter. For example, one charecter may heal all allies for 10% of there max HP on critical hit, another may summon a demon or angle or fairy on critical, another may buff there stats. (i may be talking out my ass, sense i never used the script)

Just be sure to make the follow up skill NOT criticly hit, else you'll end up with an endless loop

https://forums.rpgmakerweb.com/index.php?threads/bobstahs-critical-common-event-1-0.49709/


Edit: You may also want to lower the effectivness of critical hits for balance reasons, sense you would get *3 damage AND a follow up skill if you don't. But its your game, do what you want

Edit: Or maybe you can do it with the damage formula alone. try this
if b.result.critical; $gameTemp.reserveCommonEvent(ID)
in the damage formula

If that works, you can definitly make it call a different common event on critical per skill
I went to check out the plugin and give it a shot, but it only seems to offer calling a single common event. There aren't options to add more than one. I may be overlooking some aspect of eventing, but in that single common event I can't seem to figure out how I would be able to have the specific character who attacked use the follow-up skill without having everyone use it, or just one specific person. Conditional branching doesn't have an if CharA just used Skill1, else if CharB just used Skill1, etc. It seems as though it would be a good solution if you just have one party member, though.
OH! I think i thought of a work around were you can use that script and have different charecters have different critical follow-ups! Have all charecters skills increase a specific variable/switch, and have all other charecters skills reset thos variables/switches. Then in the common event, using conditinal branches were it has the specific actors switch/variable be checked, then using the "force action" command, you can have them launch a specific skill!

Again, be sure to turn off critical hits on the follow up skill, else an infinite loop might happen (espeacily if your raising crit chances)

Edit: I think there may be a way to affect switches/variables in the damage formula. looking now, if i find something ill post it here. this is how you would get it so this works, as i think common events trigger after damage is calculated, and so you might not be able to use a common event to check which charecter attacked, which is what im suggesting here

Edit: I found the script call for affecting switches. Hope it works in a damage formula

$gameSwitches.setValue(num, true/false);
Ok. Wavelength sent me this

if b.result.critical; $game_switches[X] = true; end; if b.result.critical; $game_switches[Y] = false; end; damage formula

Use that in the battle formula, replacing the X and Y with the switches you want it to affect. Then put contitinal branches in the common event the script calls so you can customize which critical effect you want to trigger for each charecter/skill. I think this would have the effect you desire. Let me know if it doesn't
Ok. Wavelength sent me this

if b.result.critical; $game_switches[X] = true; end; if b.result.critical; $game_switches[Y] = false; end; damage formula

Use that in the battle formula, replacing the X and Y with the switches you want it to affect. Then put contitinal branches in the common event the script calls so you can customize which critical effect you want to trigger for each charecter/skill. I think this would have the effect you desire. Let me know if it doesn't

The method works beautifully, thank you so much for taking the time to help solve this issue!

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/solved-lunatic-passive-state-force-action-if-critical-hit-is-landed.113434/