2 years ago

When a character counterattacks they always use the default attack command.

Here's a tutorial on how to make counterattacking use different skills upon being inflicted with a state in VX Ace.


First you need to be able to counterattack of course. This can simply be done by going to the Features of a state/weapon/armor and add this:

screenshot_2023-04-09_174636.png

Which is the rate of which counterattacking will activate.

Then go to the script editor and then click on Scene_Battle. Around line 615 is the code def invoke_counter_attack(target, item)

screenshot_2023-04-09_173308.png

here the skill used for counterattacking is the default attack command. replace the attack_skill line at 617 with this:

if target.state?(3)

attack_skill = $data_skills[221]

else

attack_skill = $data_skills[target.attack_skill_id]

end

screenshot_2023-04-09_173746.png

this will make so that when the counterattacking user is inflicted with state 3, which would be the blind state:

screenshot_2023-04-09_173809.png

they will counterattack with the skill with the ID 221. (note that characters with the death state can't counterattack.)

You can change skill 221 to skill 2 so that the counterattack is the guard skill.

If you want to show the attack animation for the counterattack skill, add this below the state conditional branch:

target, @subject = @subject, target

show_animation([target], attack_skill.animation_id)

target, @subject = @subject, target

screenshot_2023-04-09_180829.png

#rpgmaker #rpgmakervxace #scripting #rgss



18 comments

Loading...

Next up

What if it does increase weight 😢

Made a customizable Navigation Arrow that rotates around the player and points them to the next story location.

Making editable diary entries in Y/N's diary.

And just like that—the owner himself of the community won the #RMjam700, congratulations to @LUKELCS for the most votes for all categories from the event!

Early Access for Gefährliche Liebe - (Boy x Reader) is out.

I drew Leaven from @DevRousseau 's game; "I can fix her"

Drill Combo. The more walls you drill back-to-back the faster you get (Both drill-speed and move-speed) and in turn the less control you have in your movement.

Menu Transitions. Might still need some changes.

I do not know, but is it something like a spoiler?

In general, animations.

To celebrate 650 members in this community, I made 50 fanworks for games (And an animation for the deception jam winner), each for a person that I vaguely remember seeing a post of here. (in case your name doesn't get mentioned mb)