How To Trigger Common Event with the basic "Attack" Skill

Scenario is any of your allies use "attack" against a foe and common event triggers because the enemy dodges or has high defense. I know how to setup any skill with a common event if it's used for the first time, but how do you setup with a skill that's almost always used in battle? Does anyone have a certain troops or common event setup to make sure using "attack" in a specific battle will happen?
technically the common event can be used in attack in the same way as any other skill - attack is the skill #1 in the database.

if you want some effects to only happen under specific conditions as opposed to with every attack, then you can either have the common event contain conditional branches for them, or in the case of enemies simply don't use attack in the action patterns.

if you need more help you need to give more details than your short post above.
technically the common event can be used in attack in the same way as any other skill - attack is the skill #1 in the database.

if you want some effects to only happen under specific conditions as opposed to with every attack, then you can either have the common event contain conditional branches for them, or in the case of enemies simply don't use attack in the action patterns.

if you need more help you need to give more details than your short post above.
@Andar Ok, so this is basically want I want to happen here:

RPGMV_pslIjLlnND.png
RPGMV_1qni6Gtanv.png
RPGMV_ZlnjxK0P87.png


Using the setup for the 3 aformentioned screenshots I still can't get "Attack" to initiate the common event. What am I missing?
Using the setup for the 3 aformentioned screenshots I still can't get "Attack" to initiate the common event. What am I missing?
Your Troop Event is turning switch 99 ON.

The first line of your Common Event is only doing all the rest of the stuff if switch 99 is OFF.
You need to remove the Change Switch command from the Troop event, otherwise, it will be turning it ON even before the attack is made.
Ok, so this is basically want I want to happen here:
OK, one very basic advice:
ALWAYS write down in your own words both what you want to happen and what is happening instead.
NEVER assume that the mistake is obvious.

If I were to follow your post exactly you're telling me that you want the show text for every other troop because only in the troop you posted the troop event disables the show text. In a different troop without that troop event the common event would work automatically.

which is in itself a tip for your next bughunting: test the skill with different troops, including basic ones and never copied troops (because you might copy the mistake in such a case)
OK, one very basic advice:
ALWAYS write down in your own words both what you want to happen and what is happening instead.
NEVER assume that the mistake is obvious.

If I were to follow your post exactly you're telling me that you want the show text for every other troop because only in the troop you posted the troop event disables the show text. In a different troop without that troop event the common event would work automatically.

which is in itself a tip for your next bughunting: test the skill with different troops, including basic ones and never copied troops (because you might copy the mistake in such a case)
@Andar my fault for not being specific enough I'll be sure to apply the ALWAYS and NEVER criteria next time.

@ATT_Turan @CleanWater i removed the switch from the troop event. The common event attached to "Attack" is still not working, but this setup does work for other skills though.
correction: it DOES work it's just I had a 2nd common event attached to Attack.

Which leads to my next question:
how do i setup which common event to activate for the same skill used?

Note: I know a 2nd common event is not included in the screenshot earlier, but was wondering if the question I'm asking now can work.
correction: it DOES work it's just I had a 2nd common event attached to Attack.

Which leads to my next question:
how do i setup which common event to activate for the same skill used?
You can't. Everything you put into the Skill Effects will happen every time it's used.

You can incorporate everything into one common event and use conditionals to control what happens when.

Personally, I see you have Yanfly's Action Sequences installed and are using some - I would suggest taking the common events out of your Effects, reading up on the Action Sequences documentation, and using some conditionals and commands inside of that to call the common events.

It saves you from running that common event thousands of times in your game when you don't need to.

Option B
------------------------------------------------------------
Get rid of the common event on Attack. If that's the only skill available to you during this tutorial fight, logically it must have been used, so why does anything need to be attached to the skill?

Put it into a troop event for that specific troop. If Attack will damage the slime at all, set the troop event condition to Slime HP < 100%. If it doesn't hurt them at all, just make it go off automatically at the end of the first turn.
appreciate the help @ATT_Turan both options are great to explore with and I will work with each. That is all for this topic. 🙂
how do i setup which common event to activate for the same skill used?

You can create one single " big" Common Event with Conditional Branches that calls other Common Events. Or else, you can create these events directly in the Troops events. Basically, the same thing @ATT_Turan already said.

Spoiler
I was forbidden to recommend my game tutorial here because it's a "commercial project" (actually, it's free and financially supporting it is optional... If you have the Itch App, you can get the browser version completely free of charge, although it was not intended... xD), but I have a lesson there regarding Battle Events. It explains about how to create Events in the Battle, with some comments on each battle event created.

One reminder. You can use the "Call Common Event" command inside other Common Events. This together with Conditional Branches can do wonders! 😉

Original thread: https://forums.rpgmakerweb.com/threads/how-to-trigger-common-event-with-the-basic-attack-skill.152798/