MV How to have enemies focus healers or silence them

Hey everyone! So I'm rather new to this whole thing. I'm trying to make a certain enemy cast a silence spell on party members who heal or use magic. Is there anyway to do this. I've tried looking through the troops menu to find things for this and I can't find anything that would allow this. Thank you in advance to all who help.
specific targeting is not in the default engine, but there are limited ways to do this with the target rate.
for anything more you would need a plugin giving additional targeting options.

the first thing to think about however is how does the computer identify the healer?
you can make the enemies focus on a specific actor, but how do they know that this actor is the healer?
An additional question: Do you want the enemies to simply know who the healer is or is your expectation that they somewhat use silence on an actor after he/she has used a healing spell?
An additional question: Do you want the enemies to simply know who the healer is or is your expectation that they somewhat use silence on an actor after he/she has used a healing spell?
in my game, I setup enemy AI that will only target certain people for certain things, for example, there are anti-magic enemies who will mana burn you, but their mana burn will only ever target your casters, and never your melee
Edit: my approach would have had that effect for all enemies rather than just one.
That won't be that easy as you think, there are several factors you must have in mind making it. I'm writting my thoughts about it as is - what comes on my mind so not all things I might include, but this might be qualifies as making enemy AI, so enemy must know:

- Does enemy have healer in group?
- Does the healer has enough MP/TP to use healing?
- How many allies healer have?
- Which team member might do the most damage?
- Which enemy has the lowest value of HP / MP / TP? (if enemies skill uses TP as cost)
- What is probability to use healing spell?
- Which ally would take priority in healing order? *

* DPS, Tanker, Range attack, Caster etc.

As I said, I might forget about something important, but I hope you get the idea and someone else extend my thoughts.
What what you could do, if you have VisuStella's Battle AI plugin (for example), is create an invisible state, make it a passive on healer characters, and then give the enemies that you want to attack healers the "Target Has State" condition using the ID or name of the "healer class" state. You'd just have to give them a custom attack skill rather than using the default.
Your profile says you use MV, so I'd suggest Yanfly Battle A.I. You can use the custom condition:
Code:
Eval: target._classId==X
where X is the ID of your healer class.
Alternatively, you presumably know which members of your party are healers and which aren't. You can use a Troop Event to force the silence on the party members that qualify and only on them.
If this is for a main fight, and not general encounters, as I imagine, that might be the easiest. You could even give the special enemies a skill that calls an event and specifically targets the healers, I think.
Moved to: Plugin Request

Game Mechanics Design is for discussing mechanics. "How do I ..." questions go into either the Support forum for the appropriate engine, or Plugin/Script Requests. The general consensus above is that this can't be done easily without plugins.
An additional question: Do you want the enemies to simply know who the healer is or is your expectation that they somewhat use silence on an actor after he/she has used a healing spell?
I was hoping more for the game to silence the healer once they cast a healing spell. I used yanflys counter attack for silencing offensive casters but can’t figure out how to make them recognize a healing spell.
I was hoping more for the game to silence the healer once they cast a healing spell. I used yanflys counter attack for silencing offensive casters but can’t figure out how to make them recognize a healing spell.
Yeah, I don't think you can do that using counter attack as the heal wouldn't be targeting one of the enemies.

There are probably a few ways you could do this...here's the one that popped into my mind first. You'll need Yanfly's Skill Core.

1 - Give your troop a turn 0 event that gives your healer an invisible state. I'll call it CheckHeal. Give it an expiration at end of battle.
1a - If you use this mechanic repeatedly throughout your game, this state could just always be on as a passive state and you wouldn't need the troop event, or the expire at battle end, but I'm treating this as a one-off.

2 - Create a troop event with a span of Moment and a condition of Switch X ON (an unused switch number in your project).

3 - In the event, do Force Action from the appropriate enemy to cast silence on your healer, then turn switch X OFF

4 - In your healing spells, put the notetag:
Code:
<Custom Execution>
if (user.isStateAffected(stateId))
    $gameSwitches.setValue(X, true);
</Custom Execution>
where stateId is the ID for CheckHeal, and X is the same switch ID as above.

5 - On the map where these enemies can be fought, make an event that has a blank first page; on page 2, give it a condition of Switch X is ON, trigger type autorun, and have it turn Switch X back OFF.
5a - If this mechanic is reused throughout your game and you're using a passive state the way I described above, instead of plopping an event like this on every map, you could just use a plugin to call a common event at the end of battle that turns the switch off.
Yeah, I don't think you can do that using counter attack as the heal wouldn't be targeting one of the enemies.

There are probably a few ways you could do this...here's the one that popped into my mind first. You'll need Yanfly's Skill Core.

1 - Give your troop a turn 0 event that gives your healer an invisible state. I'll call it CheckHeal. Give it an expiration at end of battle.
1a - If you use this mechanic repeatedly throughout your game, this state could just always be on as a passive state and you wouldn't need the troop event, or the expire at battle end, but I'm treating this as a one-off.

2 - Create a troop event with a span of Moment and a condition of Switch X ON (an unused switch number in your project).

3 - In the event, do Force Action from the appropriate enemy to cast silence on your healer, then turn switch X OFF

4 - In your healing spells, put the notetag:
Code:
<Custom Execution>
if (user.isStateAffected(stateId))
    $gameSwitches.setValue(X, true);
</Custom Execution>
where stateId is the ID for CheckHeal, and X is the same switch ID as above.

5 - On the map where these enemies can be fought, make an event that has a blank first page; on page 2, give it a condition of Switch X is ON, trigger type autorun, and have it turn Switch X back OFF.
5a - If this mechanic is reused throughout your game and you're using a passive state the way I described above, instead of plopping an event like this on every map, you could just use a plugin to call a common event at the end of battle that turns the switch off.
Hi thank you so much for the help. I seem to have hit a wall. When the switch flips he keeps casting silence over and over. Would you like a picture of my state and the troop settings? Also how do I have him target the healer specificly? I confused on the index targets. It doesn't give the option to target her directly.
When the switch flips he keeps casting silence over and over.
Then you must not be including the command to turn the switch OFF.
Also how do I have him target the healer specificly? I confused on the index targets. It doesn't give the option to target her directly.
The index is simply the order the characters are in your party.
I confused on the index targets.
the index is used because the engine has no way of knowing if a skill is targeted at the actors or at the enemies.

if the skill is targeted at actors, then the index is the party order
if the skill is targeted at enemies, then the index is the order in which the enemies were added to the troop.
Then you must not be including the command to turn the switch OFF.

The index is simply the order the characters are in your party.
Then you must not be including the command to turn the switch OFF.

The index is simply the order the characters are in your party.
Ok so what if I have interchangeable parties? Is there a way to single her number out from the actors list? Because I plan on having 8 members but only 4 at a time. So she could end up in any index slot right? And I’m currently at lunch at work so I’ll have to check the no switch off thing. Is that part of the event on the map? Or do I include it in the troop event?
Ok so what if I have interchangeable parties? Is there a way to single her number out from the actors list?
Then you'll have to use a workaround (there's a more tedious built-in method, or a shorter use-some-JavaScript method).
I’ll have to check the no switch off thing. Is that part of the event on the map? Or do I include it in the troop event?
It was in my original instructions to you for how to set this up. Step 3 - One troop event with Force Action to make the enemy cast silence, then turn the switch OFF.
Then you'll have to use a workaround (there's a more tedious built-in method, or a shorter use-some-JavaScript method).

It was in my original instructions to you for how to set this up. Step 3 - One troop event with Force Action to make the enemy cast silence, then turn the switch OFF.
Thank you I believe I know where the switch needs to go. I’ll look into the JavaScript side of it. Idk much but I know a little. Thank you so much for your help! I really appreciate it your help with the last few topics of struggled with @ATT_Turan
So here are revised instructions based on you having a flexible party composition. Some of them are the same, I'll emphasize the changes:

0- Choose an unused variable in your game to use for this. I'll call it HealerIndex.

1 - Give your troop a turn 0 event that gives your healer an invisible state. I'll call it CheckHeal. Give it an expiration at end of battle.

2 - Create a troop event with a span of Moment and a condition of Switch X ON (an unused switch number in your project).

3 - In the event, make a command from tab 3 -> Script, and enter:
Code:
$gameTroop.members()[enemyIndex].forceAction(silenceId, $gameVariables.value(healerIndexId));
Replace enemyIndex with the enemy you want casting silence, in the order they were added to the troop (so the first enemy you added is 0, second is 1, etc.)
Replace silenceId with the ID of your silence skill.
Replace healerIndexId with the ID of your HealerIndex variable.

3a - This isn't new, but you missed it before: enter the event command to turn switch X OFF.

4 - In your healing spells, put the changed notetag:
Code:
<Custom Execution>
if (user.isStateAffected(stateId))
{
    $gameSwitches.setValue(X, true);
    $gameVariables.setValue(healerIndexId, $gameParty.members().indexOf(user.actorId()));
}
</Custom Execution>
where stateId is the ID for CheckHeal, X is the same switch ID as above, and healerIndexId is the ID of your HealerIndex variable as above.

5 - On the map where these enemies can be fought, make an event that has a blank first page; on page 2, give it a condition of Switch X is ON, trigger type autorun, and have it turn Switch X back OFF.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-enemies-focus-healers-or-silence-them.142202/