Help - Search - Members - Calendar
Full Version: Breath of Fire 3 - Enemy Skill System
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
TywinLannister
Breath of Fire 3 - Enemy Skill System
Version 1.0
By TywinLannister


Screenshots
None needed this time!

What it does
This script emulates the "watch enemy" system in Breath of Fire 3. That is, if an enemy uses a skill which you can learn in battle and one or more of your party is defending, there is a chance that one of your defending party members will learn the skill being used.

Version History
Version 1.0
Initial Release

Download Link
http://www.sendspace.com/file/fg5gr2

Thanks
ElementalCrisis for a simple yet effective side view battle system!
Fomar 0153 - the blue mage script came in handy.

Customising
Create a new element and call it enemy skill or whatever - make note of its id!
On line 46 of the script - ENEMY_SKILL_ELEMENT_ID = 17; change the number to your element id
on line 47 of the script - CHANCE_TO_LEARN = 100; change this to what you want the percentage chance of learning the skill to be.
Now for the skills, create a skill that your party will be able to learn and give it the enemy skill element.

Script
CODE
#==============================================================================
# ** Tywin_Enemy_Skills
#------------------------------------------------------------------------------
#  © TywinLannister, 2008
#  27/03/08
#  Version 1.0
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#   - Paste this above main
#  VERSION HISTORY:
#   - 1.0 (27/03/08),  Initial release.
#==============================================================================

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------

class Game_Party
  #--------------------------------------------------------------------------
  # * Alias listings
  #--------------------------------------------------------------------------
  alias tywin_skill_initialize initialize
  
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :enemy_skills_learned     # enemy skills already learned by the party.
  
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    tywin_skill_initialize
    @enemy_skills_learned = []
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  ENEMY_SKILL_ELEMENT_ID = 17
  CHANCE_TO_LEARN = 100
  
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias tywin_skill_execute_action_skill execute_action_skill
  
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Skill
  #--------------------------------------------------------------------------
  def execute_action_skill
    tywin_skill_execute_action_skill
    defending_members = []
    chance_to_learn = CHANCE_TO_LEARN
    skill = @active_battler.action.skill
    if skill.element_set.include?(ENEMY_SKILL_ELEMENT_ID)
      if not $game_party.enemy_skills_learned.include?(skill.id)
        for member in $game_party.existing_members
          if member.guarding?
            defending_members.push(member)
          end
        end
      end
    end
    if defending_members.size > 0
      learn_chance = rand(100)
      if learn_chance < chance_to_learn
        member_to_learn = defending_members[rand(defending_members.size)]
        member_to_learn.learn_skill(skill.id)
        $game_party.enemy_skills_learned.push(skill.id)
        wait(10)
        @message_window.add_instant_text(member_to_learn.name + " learns " + skill.name)
        wait(60)
      end
    end
  end
  
end
SarunPhin
Very nice cuz i was going to do a BOF spin off as well.... But can u give skills u learn to other party members and can one person learn it only?!!

Once agin Good job
Kinnison
Awesome, I think BOF4 also have the same kind of feature.
illustrationism
This is very cool. A nice simple little addition (my favorite kind). smile.gif
LrdOfNightmares
BREATH OF FIRE RULES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Warned for spamming. Thanks!
luciddose
Wow truly amazing script - thanks and keep up the good work!
TywinLannister
@SarunPhin: Yup, i'm going to implement the feature where you can change skills between different party members at some point! working on another BOF script at the mo though which i want to finish and get out there!

@illustrationism: I wish all of the additions i have planned were as simple, lol! unfortunately not though!!!!!

@all: cheers for the remarks! and keep an eye for future updates!
Tomo009
my only question is, does this affect every party member? or can you chose which characters can learn them?
TywinLannister
@Tomo009: Only characters who are currently guarding are able to learn the skill. So if you want to guarantee only one party member will try and learn the skill, only defend with that member. Each skill can only be learned once.
Tomo009
what i want to know is can u exempt someone from learning skills through that system using the script?
TywinLannister
@Tomo009: As it stands no. I never considered it as breath of fire doesn't exclude members from learning the skill, however, i have no problem at all inserting that functionality into the script for the next update!
Mefisno
can someone help me for some reason the script is not working ive created the Enemy skill element and inserted the script but i don't know whats going wrong.
i may have put it in the wrong place though i put it right at the top of Main.
Mefisno
QUOTE (Mefisno @ Apr 18 2008, 02:40 AM) *
can someone help me for some reason the script is not working ive created the Enemy skill element and inserted the script but i don't know whats going wrong.
i may have put it in the wrong place though i put it right at the top of Main.



ok i have fixed my previous problem but now i get this error when my enemies use the enemy skill moves

Script "Main" line 63: NoMethodError occurred.
undefined method `include?" for nil:NilClass

can someone help me?

Hmm sorted it now it was just doing one of it's weird and wonderful things happy.gif
Ahegil
when using this do you have to replicate the script for each enemy skill or can you just add a new line?
nevious
this is a great script and i would love to use it.... save for one problem.... the fact that anyone defending can learn the skill... if there was a way to implement something in to the script to make it one person able to use it or maybe a certian class or someone using certian matiria or such things then that would be great... but i guess it will suffice for now... (not trying to imply the script is bad becouse its not its a great script) if someone could fix something like this please let me kno...
xtoothpickx
I too would like for this one to be more character specific. Maybe add a section that includes character id so only those characters can learn them. I THINK it would be a simple addition but im only still learning ruby.

Hope this isn't necroposting!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.