Need Help For Special Battle Events

Hiya guys! I'm new to RMMV and to the community! I'd like to ask help for this specific battle event trigger I'd like to do. There might be solutions to this already but honestly I don't know the name to google. I'm also okay if plugins can be the solutions!

I want to add a special trigger event (dialogue) in battle for tutorials. I want to add something like, for example: A character tells you to try out your physical attack but you did magic attack instead, so I want a dialogue triggered saying "that's not physical attack, try again!". I tried exploring conditional branch but I didn't see for such option.

Thank you very much!
The javascript code "$gameActors.actor(1).lastBattleSkill().id" will give you the id of the last skill used by actor 1 (or change that 1 to see actor 2, etc). So, if your normal attack is skill 1, then your conditional branch will want to use the Script option on page 4, and you type in
Code:
$gameActors.actor(1).lastBattleSkill().id == 1
That will be true if the last skill used by actor 1 was skill 1, or false if it wasn't.
The javascript code "$gameActors.actor(1).lastBattleSkill().id" will give you the id of the last skill used by actor 1 (or change that 1 to see actor 2, etc). So, if your normal attack is skill 1, then your conditional branch will want to use the Script option on page 4, and you type in
Code:
$gameActors.actor(1).lastBattleSkill().id == 1
That will be true if the last skill used by actor 1 was skill 1, or false if it wasn't.
Thank you so much! It does work! But of course, I ran into a problem where it jumps to battle event page 2 instead of looping back to page 1. This is what the event looks like currently and I'm pretty clueless how to make everything connect like:

NPC tells to do A, player did B instead.
So now NPC wants player to do A again, and player finally did. Now NPC wants player to do B.
Also if player did C (Escape) in the beginning, NPC won't let you.

I apologize if it's a little too much! I'm an artist exploring RMMV and I've done not much scripting, coding or anything alike.
Thank you so much! It does work! But of course, I ran into a problem where it jumps to battle event page 2 instead of looping back to page 1. This is what the event looks like currently and I'm pretty clueless how to make everything connect like:

NPC tells to do A, player did B instead.
So now NPC wants player to do A again, and player finally did. Now NPC wants player to do B.
Also if player did C (Escape) in the beginning, NPC won't let you.

I apologize if it's a little too much! I'm an artist exploring RMMV and I've done not much scripting, coding or anything alike.

I think it's probably because of the Conditionals on the battle pages. You have the Conditions on page 2 set to "Turn End, Turn 1". That means it will only ever try to run that page on Turn 1, and won't try to run it after that. If you need it to loop back, you need it to keep trying to run. Changing it to "Turn End, Turn 1*X" will try to run it every single turn, which also isn't great, but a bit closer! I think you'll want to use Switches (or Variables) in combination with that. For example, you could have one Switch for "Player successfully used physical attack" and another for "Player successfully used magic attack" (only call them something a bit shorter). Then you only need one battle page, set to "Turn End, Turn 1*X", and add various conditional branches within it to only run stuff if the right switches are set.

It would look something like:

Code:
If: UsedPhysicalAttack is OFF:
  If: $gameActors.actor(1).lastBattleSkill().id == 1
    Text: Used a physical attack!
    Control Switches: UsedPhysicalAttack = ON
  Else:
    Text: No, try again.
Else:
  If: $gameActors.actor(1).lastBattleSkill().id == 2
    Text: Used a magic attack!
    Control Switches: UsedMagicAttack = ON
  Else:
    Text: No, try again.

(That's just to give you a rough idea). So, on the branch where they successfully use the move you set the switch to be ON, and then next turn you'd follow down the other branch if that switch is ON. You could also use a Variable, and add 1 to it each time they progress through you're tutorial, and in the conditionals check to see what value it is to know which part to run.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-for-special-battle-events.175827/