Is there a script to change an enemy's Counterattack to another skill?

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
I have a bit of a problem. My enemies don't use the default attack command because I have the default attack command factoring level into the equation, which is good for my party members, but causes enemies to only deal 1 damage (they would deal 0, but I have a script to make 1 the minimum). Problem is, I can't make enemies counterattack because of this, since CNT calls for Skill #1 (Attack).

I need a script that will allow me to call another skill for an enemy's counterattack, specifically, the one I use to calculate an enemy's normal attack. Potentially, this could also be used to make enemies counter with other things, like spells.
 

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Wow....that sounds really, REALLY dumb. By legal standards that's not considered Commercial at all. It's sort of like Kickstarter, you can donate but it's still non-commercial if the released product is free.

I'll see if I can find one by another scripter somewhere on google. I honestly don't like Victor myself lol. His scripts are cool and all but....his personality? Nuh-uh.
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
Do you use one particular skill for the default monster attack, or does each monster use a different skill?
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Well I thought of this, not sure if it works when it comes to @subject.id    If anyone can point out and fix this up then feel free to do so.

Code:
class Game_BattlerBase  def counter_skill_id    if @subject.id == 1    #set specific actor id check      return 10           #returns this skill id    elsif @subject.id == 2      return 11    elsif @subject.id == 3      return 12    else @subject.id == 4      return 13    end  endendclass Scene_Battle < Scene_Base  def invoke_counter_attack(target, item)    @log_window.display_counter(target, item)    attack_skill = $data_skills[target.counter_skill_id]    @subject.item_apply(target, attack_skill)    refresh_status    @log_window.display_action_results(@subject, attack_skill)  endend
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
Do you use one particular skill for the default monster attack, or does each monster use a different skill?
Different. For example, if the enemy uses a bludgeoning attack, I use one with a "hit" animation, but if they use a slashing attack, I use one with a "slash" animation.

Well I thought of this, not sure if it works when it comes to @subject.id    If anyone can point out and fix this up then feel free to do so.

class Game_BattlerBase def counter_skill_id if @subject.id == 1 #set specific actor id check return 10 #returns this skill id elsif @subject.id == 2 return 11 elsif @subject.id == 3 return 12 else @subject.id == 4 return 13 end endendclass Scene_Battle < Scene_Base def invoke_counter_attack(target, item) @log_window.display_counter(target, item) attack_skill = $data_skills[target.counter_skill_id] @subject.item_apply(target, attack_skill) refresh_status @log_window.display_action_results(@subject, attack_skill) endend
Can anyone confirm that this works? I have a lot of scripts installed and if something were to be wrong, it would be very hard for me to pinpoint the problem.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Can anyone confirm that this works? I have a lot of scripts installed and if something were to be wrong, it would be very hard for me to pinpoint the problem.
As long as no other custom scripts involve those two definitions, it should be fine. You can check using Ctrl+Shift+F

def counter_skill_id I made up myself so I doubt that was used already.
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
As long as no other custom scripts involve those two definitions, it should be fine. You can check using Ctrl+Shift+F

def counter_skill_id I made up myself so I doubt that was used already.
I see. Wait, what am I supposed to put in the top marked field?
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
I see. Wait, what am I supposed to put in the top marked field?
All you need to do is edit the @subject.id == # (actor id number, I already made it for upto 4 actors), and the return # (skill id number to counter with)

Exactly as I had it there.
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
All you need to do is edit the @subject.id == # (actor id number, I already made it for upto 4 actors), and the return # (skill id number to counter with)

Exactly as I had it there.
But it's not for actors... it's for enemies...
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
854
First Language
English
Primarily Uses
RMMV
The following script appears to work alright, but the selected counter skill does not show an animation, play sound or use multiple attacks (simply deals the calculated damage of the selected skill). I am working on forcing the skill to trigger, but targeting is currently holding me up. The battle engine is not my place of expertise.

All you need to do is add the following tag to the note field of the enemy : 'counter_skill => {skill_id}' (example : counter_skill => 15).

class Game_BattlerBase #-------------------------------------------------------------------------- # * Get Skill ID of Normal Attack #-------------------------------------------------------------------------- unless method_defined?:)ex_gbb_091513_attack_skill_id) alias_method:)ex_gbb_091513_attack_skill_id, :attack_skill_id) end def attack_skill_id(*args, &block) if caller(1)[0].include?("invoke_counter_attack") && self.enemy? counter_hash = {} $data_enemies[self.enemy_id].note.split(/[\r\n]+/).each do |line| if line =~ /\A\s*[^\s:]*)\s*=>\s*(.*[^\s,])/ counter_hash[$1.to_sym] = eval($2) rescue $2 end end return counter_hash[:counter_skill] else ex_gbb_091513_attack_skill_id(*args, &block) end endendEDIT : Minor patch-fix to make certain that an enemy is the one counter-attacking.EDIT II : Hurf, actually, just use Tsukihime's Counter Skills or Formar's Counter Skills.
 
Last edited by a moderator:

Little Paw

Veteran
Veteran
Joined
May 5, 2013
Messages
707
Reaction score
294
First Language
English
Primarily Uses
The following script appears to work alright, but the selected counter skill does not show an animation, play sound or use multiple attacks (simply deals the calculated damage of the selected skill). I am working on forcing the skill to trigger, but targeting is currently holding me up. The battle engine is not my place of expertise.

All you need to do is add the following tag to the note field of the enemy : 'counter_skill => {skill_id}' (example : counter_skill => 15).

class Game_BattlerBase #-------------------------------------------------------------------------- # * Get Skill ID of Normal Attack #-------------------------------------------------------------------------- unless method_defined?:)ex_gbb_091513_attack_skill_id) alias_method:)ex_gbb_091513_attack_skill_id, :attack_skill_id) end def attack_skill_id(*args, &block) if caller(1)[0].include?("invoke_counter_attack") && self.enemy? counter_hash = {} $data_enemies[self.enemy_id].note.split(/[\r\n]+/).each do |line| if line =~ /\A\s*[^\s:]*)\s*=>\s*(.*[^\s,])/ counter_hash[$1.to_sym] = eval($2) rescue $2 end end return counter_hash[:counter_skill] else ex_gbb_091513_attack_skill_id(*args, &block) end endendEDIT : Minor patch-fix to make certain that an enemy is the one counter-attacking.EDIT II : Hurf, actually, just use Tsukihime's Counter Skills or Formar's Counter Skills.
Tsukihime's Counter Skills works perfectly, thanks!

Sorry for all the trouble ^_^;
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top