Jump to content


Photo

Counter Skills


  • Please log in to reply
35 replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 15 May 2012 - 10:31 PM

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, 07 July 2016 - 10:31 AM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#2 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5609 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 15 May 2012 - 10:45 PM

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'

gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png


#3 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 15 May 2012 - 10:48 PM

1. Bug with nilclass is something I should have tested but wasn't sure how to trigger it lol

2. Are you sure you can use it?
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#4 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5609 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 15 May 2012 - 10:50 PM

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, 15 May 2012 - 10:52 PM.

gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png


#5 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 15 May 2012 - 10:59 PM

Done.

You can disable battle switching as well.

Edited by Tsukihime, 15 May 2012 - 11:01 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#6 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5609 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 15 May 2012 - 11:18 PM

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, 16 May 2012 - 12:55 AM.

gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png


#7 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 16 May 2012 - 04:34 PM

I've moved the counter_skill variable to Game_Battler.
But now I want to allow enemies to have counter skills hmmm
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#8 Dark Horseman

Dark Horseman

    NPC

  • Member
  • 325 posts
  • RM Skill - Artist

Posted 16 May 2012 - 05:32 PM

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, 16 May 2012 - 05:33 PM.


#9 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 16 May 2012 - 05:49 PM

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).
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#10 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5609 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 16 May 2012 - 05:53 PM

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

gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png


#11 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 16 May 2012 - 06:19 PM

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, 16 May 2012 - 06:20 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#12 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5609 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 16 May 2012 - 07:32 PM

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, 16 May 2012 - 07:33 PM.

gs-banner_zpsfc59b073.pngp7GQmH4.png 2hjKrWv.png


#13 Chaos17

Chaos17

    Advanced Member

  • Member
  • 344 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2012 - 11:04 PM

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 ?

ban.png


#14 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 16 May 2012 - 11:15 PM

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.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#15 Ravenith

Ravenith

    Abandoning projects since 2001

  • Member
  • 104 posts
  • LocationGreece
  • RM Skill - Designer

Posted 29 May 2012 - 12:54 AM

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!

#16 WCouillard

WCouillard

    Sanubian Menace

  • Member
  • 1188 posts
  • RM Skill - Jack of All Trades

Posted 11 September 2012 - 03:37 PM

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?

My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#17 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 11 September 2012 - 03:52 PM

Probably, but I don't plan on implementing it. You'll need to first figure out how to actually specify it.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#18 WCouillard

WCouillard

    Sanubian Menace

  • Member
  • 1188 posts
  • RM Skill - Jack of All Trades

Posted 11 September 2012 - 05:18 PM

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.

My Completed Scripts: http://pastebin.com/u/WCouillard

Final Fantasy Discovery: http://www.rpgmaker.net/games/4071/


#19 Tsukihime

Tsukihime

    Advanced Member

  • Member
  • 7120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 11 September 2012 - 06:00 PM

The problem is not it being hard to implement. I just have no idea how people should be using it. The things I come up with are more for computers and not people.
All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.pnglogo_instagram40x40.png

Go here for Bugs and Requests.
 
Want to become a beta tester for my plugins before they are released to the public?

#20 Animebryan

Animebryan

    Hiatus

  • Member
  • 581 posts
  • LocationMarysville, CA
  • RM Skill - Eventer

Posted 05 October 2012 - 05:31 PM

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:

Damn MV and it's bugs!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users