Confusion Modification

So, I'm wanting to change the way confusion-like states work in my game. I'm wanting to make it so that, when an actor/enemy afflicted with a confusion state uses a skill which targets either an ally or an enemy, there's an X% chance (determined by the state) for it to target the reverse (for example, a healing spell's target being switched to an enemy or a fireball being cast on your ally). I want this to be something that can be set so that there can be severity of confusion states (there can be weak mind control spells that make your enemies occasionally choose the wrong target, but later-level ones make it so they're only attacking other enemies).

Is there a plugin that does this? Would anyone like to make one?
DoubleX made a "Confusion Edit" plugin that offers the ability to swap the target unit depending on the state's Restriction: 50% chance to swap if Attack Anyone, 100% chance if Attack Ally. Here's a link: https://rpgmaker.net/scripts/651/
DoubleX made a "Confusion Edit" plugin that offers the ability to swap the target unit depending on the state's Restriction: 50% chance to swap if Attack Anyone, 100% chance if Attack Ally. Here's a link: https://rpgmaker.net/scripts/651/

I tried that, though something's not right. As far as I can tell it still only lets an actor attack rather than use any ability.
Stupid question : do you put the notetag in the confusion state ?
Stupid question : do you put the notetag in the confusion state ?
I'm pretty sure you do. Though it doesn't appear to work for me for some reason.
Hmm...I just tested and it seems OK for me without any other plugins. 😅 I put this in the notebox of the Confusion state in a new project:
Code:
<confusion edit: true, true>
Then I put a troop event to make all actors confused on Turn 0. Harold casts Spark, Marsha casts Fire, sometimes they even hit the enemies. It seems to work for me with confused enemies, too: they'll use skills other than Attack, and target a random unit.

Did you save your project after adding the plugin and before testing? If you were using battle-test, maybe try quickly setting up a map event with Battle Processing to see if it works in play-test.

Edit: another idea: did you remember to set the state's Restriction to Attack Anyone or Attack Ally?
Hmm...I just tested and it seems OK for me without any other plugins. 😅 I put this in the notebox of the Confusion state in a new project:
Code:
<confusion edit: true, true>
Then I put a troop event to make all actors confused on Turn 0. Harold casts Spark, Marsha casts Fire, sometimes they even hit the enemies. It seems to work for me with confused enemies, too: they'll use skills other than Attack, and target a random unit.

Did you save your project after adding the plugin and before testing? If you were using battle-test, maybe try quickly setting up a map event with Battle Processing to see if it works in play-test.

Edit: another idea: did you remember to set the state's Restriction to Attack Anyone or Attack Ally?
I suspect it's an issue with some form of plugin conflict-now it just seems to crash the game for some reason.
Truth be told the plugin isn't quite what I'm looking for anyways-I'm mostly looking for ways to make degrees of confusion between 'attack anyone' and 'attack an ally'.

IE, a low level mind control spell might make a target have a 20% change to attack an ally, while a high level one has a 100% chance, etc.

Original thread: https://forums.rpgmakerweb.com/threads/confusion-modification.103252/