Using an attack turns on a switch

Hello! I searched the forums and I tried really hard to event it, but I just can't figure it out.


Back in RPG Maker 2003, you had this neat little feature when making an attack:

Spoiler
1r.png



And it could do neat things, like examine your opponent:

Spoiler
2r.png





And I can't, for the life of me, figure out how to do it in VX Ace. It feels like the answer is really obvious, but it's just not to me.


Thank you to anyone who can help!
There could be a more streamlined way of doing this, but if you go into the "effects" section, you can call a common event. From that common event, you can control switches.
What @Membou suggested is the most straightforward way; if the skill has a damage formula you can also use the damage formula to turn on a switch; for example: $game_switches[25] = true; a.mat * 4 - b.def * 2 (this has a couple of small advantages over the use of common events)


If you are using a lot of skills that turn on specific switches, Scripting would be the quickest (but most technically difficult) way to do it.
Common eventing wouldn't work in battle for me, but what Wavelength suggested did work! Thank you so much!
if your switch is to turn on a parallel process common event, then no, they don't run in battle.  This is the reason you can use the Effects box to allocate a common event to a skill.  It is called directly, rather than relying on parallel processing (which isn't active in battles), but it is called at the end of the attack, so not so good for things you want to happen before or during an attack.
@Shaz, Thanks for the clarification there. I'm sorry if this seems needy, but could you give me an example of what sort of thing you would want to use a common event for in the effects section? (nothing in-depth, but just an idea of when it would be more appropriate)


I know that's really broad but I'm just trying to learn more and become more versatile in the program, and a reason why I've been jumping into this section to answer any questions to the best of my ability, even if eventually someone else has a more precise answer.
If you want to perform some other actions after you use a skill or an item, that can't be done in the damage formula
Okay, so basically dealing with the timing of the action, got it. Thanks!
Let's say you have an actor, and every time they use a certain skill you want to increase a variable, and when it hits a certain value, you want them to upgrade the skill.


Your common event would be to add 1 to a variable, followed by a conditional branch to see if the variable is a certain number, and if it is, remove that skill and add a new one.  You then attach this common event to the original skill in the Effects panel, and those few commands will be run every time the actor uses that skill in battle.


That's just one simple example.  There are heaps of things you could do.  The above COULD be done in the damage formula, but it would be long-winded and not something you'd want to try if you knew nothing about scripting.  There could also be plugins that would do this sort of stuff too, and you might go with one of those if you wanted to do it quite a bit.  But it's an example of one thing you could do with common events on skills.
Let's say you have an actor, and every time they use a certain skill you want to increase a variable, and when it hits a certain value, you want them to upgrade the skill.


Your common event would be to add 1 to a variable, followed by a conditional branch to see if the variable is a certain number, and if it is, remove that skill and add a new one.  You then attach this common event to the original skill in the Effects panel, and those few commands will be run every time the actor uses that skill in battle.


That's just one simple example.  There are heaps of things you could do.  The above COULD be done in the damage formula, but it would be long-winded and not something you'd want to try if you knew nothing about scripting.  There could also be plugins that would do this sort of stuff too, and you might go with one of those if you wanted to do it quite a bit.  But it's an example of one thing you could do with common events on skills.

Okay, great! That definitely gets the wheels turning, and helps distinguish between the two methods. Thanks for going above and beyond on that. 😀

Original thread: https://forums.rpgmakerweb.com/threads/using-an-attack-turns-on-a-switch.65229/