Tsukihime

Counter Skills

36 posts in this topic

Counter Skills

Author: Tsukihime

 

112gD.jpg

 

Overview

 

Counter-attack with default attack skill? How about choosing which skill you want to counter with?

Supports both offensive and support skills, so maybe everytime you get attacked you want to heal yourself.

 

Features

  • Choose which skill to use as your counter-skill
  • Can switch counter-skill during battle
  • Set-up default counter skills for both enemies and actors
Usage

 

To choose a counter-skill, go to the Skills menu, move the cursor to the skill you want to choose, and then press the A key. If you are not using the default keyboard, the skill is set to the "X" key in the game's settings.

 

You can specify whether all skills can be selected, only certain skill types can be selected, or only the tagged skills.

 

To specify that a skill can be used as a counter-skill, type in

 

 

<counter-skill>
in the skill's notebox.

 

To set up default counter skills for enemies and actors, just tag in their noteboxes

 

<counter-skill: x>
Where x is the skill ID you want to use as the default counter skill.

Note that you must have the skill to be able to use it

 

Download

 

Script: Download here

 

Credits

 

Galv for some implementation ideas

Edited by Tsukihime

Share this post


Link to post
Share on other sites

You sure work fast, Tsukihime!

 

Got some trial bugs below:

 

1. I just tried pressing "A" when a character has no skills. (So pressed "A" on an empty spot where a skill should be).

"line 181:NoMethodError occurred. undefinted method 'stype_id' for nil:NilClass"

 

2. I am have just tested using only the skill type ID. While it allows me to successfully highlight skills only from my chosen skill type, they don't get used in combat. The counter 'invulnerable' part works but then no skill is used for the counter attack'

Share this post


Link to post
Share on other sites

2. Ah cancel that I worked out why. It worked on your original test I did, but in my chain-attack script I have skills set to "only useable during a chain". I tried turning that off and it works.

So it's no problem now haha... I don't want to use chain-only skills for counters anyway. Was just the skill I randomly picked to test :P

 

EDIT: How hard would it be to make it possible to select your counter skill during combat?

Edited by Galv

Share this post


Link to post
Share on other sites

Fantastic, seems to all be working nicely for me so far, haven't found another way to break it yet but will let you know :P

Very cool script, Tsukihime.

 

 

EDIT: Having a problem, when the enemy activates a counter attack (ie. you hit them when they have the counter state) it brings up this error:

 

line 126: NoMethodError occurred.

undefined method 'counter_skill' for #<Game_Enemy:0xa2a4dd8>

Edited by Galv

Share this post


Link to post
Share on other sites

Does this have to be set manually at the start of the game? Having characters counter with different abilities adds a lot of favor, but what if I didn't want to bother the player with choosing the skill, i.e. by default the actor responds with a certain skill? Also, does this have a "force action" functionality or is it a free action for every counter attack?

Edited by Dark Horseman

Share this post


Link to post
Share on other sites

I can provide notetags for specifying default counter skills.

 

Yes, you're basically pulling off free attacks everytime you counterattack.

However, it will obey all skill usage conditions (eg: you will still consume MP/TP).

Share this post


Link to post
Share on other sites

I agree with Dark Horseman that the ability to set a character's counter skill by default would be a great idea.

 

@Tsukihime - I've tried your latest code and it's throwing me a new error on battle start.

"Script 'Game_Actor' line159: NoMethodError occurred.

private method 'select' called for nil:NilClass"

 

Might be a script conflict perhaps, haven't tested that yet

Share this post


Link to post
Share on other sites

I've added support for enemy and actor default counter skills.

Just tag the actor/enemy with

 

<counter-skill: x>

 

For some skill ID. You must have the skill in order to use it, so the enemy must have learned that skill. I will extend this to classes later, when I think of the best way to specify that actors take priority over classes.

 

I've also improved the target system. Now I use the Game_Action.make_targets method which will handle all the ugly scope checks for me.

 

"Script 'Game_Actor' line159: NoMethodError occurred.

private method 'select' called for nil:NilClass"

 

I don't think it's the counter skills script that's raising the error. The latest copy has an empty line at 159.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

The error was in "Game_Actor" script. It was a conflicting Yanfly's Weapon Replace script and this one. I no longer needed the weapon replace script so I removed it and all happy now haha.

Edited by Galv

Share this post


Link to post
Share on other sites

Is possible to add this feature : make appear the counter skill on the screen but the player need to push a button to be able to activate it ?

Yanfly combo script allow a similar featur : have to press a button.

Of course the player will have a limited time to do it.

 

What to you think ?

Share this post


Link to post
Share on other sites

Probably, but if I were going to add that, I would write a generic input script that could be used anywhere to trigger things and then just call it during counter-attack. Seems more useful than making something specifically for counter attacks.

Share this post


Link to post
Share on other sites

Nice implementation. Could I provide my two bits of wisdom? It would be great to have states that set the counter attack skill to a specific skill. That would allow some additional design space without being too hard to implement.

 

Anyway, good job!

Share this post


Link to post
Share on other sites

Would it be possible to add eval to the notetag so that the counter-skill would only activate on certain conditions being met? Such as an actor's TP being full, or half-full, or at low HP?

Share this post


Link to post
Share on other sites

Well, boo. Would be nice to be able to control this even further, but it's a great start. Would you mind taking a look at my support topic about Window_BattleLog? I have a feeling you'll be able to figure that one out fast.

Share this post


Link to post
Share on other sites

Having a problem with the script. It's not offering me the selection of skills to choose from, it just does a regular counter attack. I'm also getting a error in battle. I couldn't tell if it was from Yanfly's Lunatic States script with the Punishment & Protection packages or your Counter Skills script. Here's the error:

Share this post


Link to post
Share on other sites
I couldn't tell if it was from Yanfly's Lunatic States script with the Punishment & Protection packages or your Counter Skills script

 

I wouldn't know either.

Share this post


Link to post
Share on other sites

I couldn't tell if it was from Yanfly's Lunatic States script with the Punishment & Protection packages or your Counter Skills script.

You could try to find this out by running some more tests. Test it with/without each script installed.

Share this post


Link to post
Share on other sites

If I have a counterattack state on & I'm attacked, does the skill selection show up automaticly or do I have to push a button at the right time before a regular counterattack goes off?

Share this post


Link to post
Share on other sites

Neither.

You go to your skill list and press the A key to select a skill to use for counter attacks.

Is that during battle or on the menu? I may have to experiment on which is my 'A' key seeing as I'm using a PS3 controller to play my game.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.