Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Hello, I am trying to create a counter-attack state, but can't seem to get things working right.

I want the character to actually take the attack before counterattacking, instead of the default dodge in vanilla MZ. I'm using Visustella Plugins (specifically Auto Skill Triggers) to do this. First I create a state that gives the character the skill, so that when the are hit by a physical attack the character takes the hit then counterattacks. This works but with one problem, the attacker simply attacks a random target instead of enemy that attacked.
1638329428492.png

1638329297816.png

Is there any way to control the counterattack target, or do I have to approach this a different way?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,178
Reaction score
1,878
First Language
English
Primarily Uses
RMMV
Unless there are any settings in the plugin parameters, the Auto Skills plugin doesn't allow any kind of targeting with the notetags.

Yanfly wrote a Counter Control plugin for MV, but I don't see anything by VisuStella that reproduces it. Perhaps it works via FOSSIL?

The other approach I thought of was Yanfly's states plugin had lots of tags for code to be executed at different times of the battle turn (custom respond effects, etc.) but, again, I'm not seeing any equivalents in the VisuStella states plugin.
 

Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Thanks for the reply.

Well that's a pain. Can I do anything with the Javascript notetags? I not exactly literate with Javascripting, but I can get my head around the simple stuff with a bit of trial and error.

Fossil seems like an interesting idea. I dabbled with MV and Yanfly back with my old computer, but that was long enough ago that I thought starting from scratch with MZ would be a better idea. Does anyone know if it clashes with the MZ Visustella plugins?

I did think about doing the counterattacks with common events, might have to give that a shot. If that doesn't work then I'll look into FOSSIL.
 

NaosoX

Veteran
Veteran
Joined
Feb 28, 2013
Messages
357
Reaction score
187
First Language
English
Primarily Uses
RMMZ
You wanted something like this?

StateActivation.png
Skill which adds state

CounterState.png
This state adds the skill Counter Attack

CounterSkill.png
Skill added by state, hidden in battle.
Auto Skill Trigger set.
Linked to Common Event: CounterAttack

There are a few ways to do this, here is one I think you can customise to your liking.

Setting variable from here will add 1, so to counter act this effect, Control Variable again, but subtract 1.

Code:
◆Control Variables:#0044 Counter Target = Last Enemy Index to Act
◆Control Variables:#0044 Counter Target -= 1
◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Setup Action Set
:              :Display Action = true
:              :Immortal: On = true
:              :Battle Step = true
:              :Wait For Movement = true
:              :Cast Animation = true
:              :Wait For Animation = true
◆If:Counter Target = 0
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 0"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 0"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 0"]
  ◆
:End
◆If:Counter Target = 1
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 1"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 1"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 1"]
  ◆
:End
◆If:Counter Target = 2
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 2"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 2"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 2"]
  ◆
:End
◆If:Counter Target = 3
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 3"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 3"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 3"]
  ◆
:End
◆If:Counter Target = 4
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 4"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 4"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 4"]
  ◆
:End
◆If:Counter Target = 5
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 5"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 5"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 5"]
  ◆
:End
◆If:Counter Target = 6
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 6"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 6"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 6"]
  ◆
:End
◆If:Counter Target = 7
  ◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
  :              :Targets (Moving) = ["user"]
  :              :Targets (Destination) = ["enemy index 7"]
  :              :Target Location = front base
  :              :Melee Distance = 24
  :              :Offset Adjustment = horz
  :              :Offset: X = 0
  :              :Offset: Y = 0
  :              :Duration = 12
  :              :Face Destination? = true
  :              :Movement Easing = Linear
  :              :Movement Motion = walk
  :              :Wait For Movement? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Wait:30 frames
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["enemy index 7"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["enemy index 7"]
  ◆
:End
◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Home Reset
:              :Targets = ["user"]
:              :Wait For Movement? = true
◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Finish Action
:              :Immortal: Off = true
:              :Wait For New Line = true
:              :Wait For Effects = true
:              :Clear Battle Log = true
:              :Home Reset = true
:              :Wait For Movement = true
 
Last edited:

Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Thanks, I'll see if that works.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,736
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Support. Thank you.

 

Lizardcats

Villager
Member
Joined
Nov 5, 2021
Messages
6
Reaction score
1
First Language
English
Primarily Uses
RMMZ
Thanks so much. Also, sorry for double-posting.

It works perfectly. I'll admit I had a bit of a mix up with the enemy index/ID in the plugin commands, and was left wondering why the countering character disappeared entirely and only countered certain enemies (whose shared an ID/Index number). But after fixing that, everything worked just fine.

I was also concerned that multiple actors having the skill at the same time would cause problems, as well as if party-wide attacks would cause problems either (and obviously both at once). But it works perfectly in all three situations.
 

NaosoX

Veteran
Veteran
Joined
Feb 28, 2013
Messages
357
Reaction score
187
First Language
English
Primarily Uses
RMMZ
Im glad you enjoy it :D
 

Latest Threads

Latest Posts

Latest Profile Posts

I think Kipling said it best.

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
⁠And never breathe a word about your loss,
(...)
Yours is the Earth and everything that's in it,
⁠And—which is more—you'll be a Man, my son!


Do you feel like your modern cities are too clean? I made some dumpsters and trash variations. Visit my MZ resource thread (link in signature).
Doing clean-up on tall-ified sprites, filling in pixel by pixel where the stretching warped the image, feels incredibly tedious but also highly rewarding when one zooms out and the sprite looks even better than before.

Forum statistics

Threads
118,578
Messages
1,117,095
Members
155,634
Latest member
andina
Top