Jump to content
Sign in to follow this  
roguewildchild

Skill Set Effect Error Line 37

Recommended Posts

image.thumb.png.ef8bb65b7936ec7c76f7f4e7d96b26ee.png

 

During the Tutorial we are given a script to copy: 

#===============================================================================
# Skill Self Effects
# By Jet10985 (Jet)
# Requested by Touchfuzzy
#===============================================================================
# This script will allow you to specify a skill's effects tot arget the user
# instead of the target, on skills that don't already effect the user.
# This script has: 0 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: item_effect_apply
#===============================================================================
=begin
To specify the effects, use this notetag in the skill's notebox:

<self effect: 1>
or
<self effect: 1, 2, 3> to specify more than 1 effect
--------------------------------------------------------------------------------
Use of this script could be as the following.

You make a "Berserk Strike" skill, which does 200% damage to an enemy.
You make the 2nd effect "Defense Down 50%" and want it applied to the user.
You'd use this notetag: <self effect: 2>
=end

class RPG::Skill
  
  def self_effects
    if @self_effects.nil?
      @self_effects = []
      self.note.each_line {|a|
        scan = a.scan(/<self[ ]*effect[ ]*\:[ ]*(\d+(?:[ ]*,[ ]*\d+)*)>/i)
        scan[0][0].scan(/\d+/).each {|b| 
          @self_effects.push(@effects[b.to_i - 1]) if b.to_i >= 1
        }
      }
    end
    @self_effects
  end
end

class Game_Battler
  
  alias jet3745_item_effect_apply item_effect_apply
  def item_effect_apply(user, item, effect, reffed = false)
    if item.is_a?(RPG::Skill) && item.self_effects.include?(effect) && !reffed
      user.item_effect_apply(user, item, effect, true)
      return
    end
    jet3745_item_effect_apply(user, item, effect)
  end
end

 

....
What do I change so my basic attack won't read this script and get an error?

Edited by roguewildchild

Share this post


Link to post
Share on other sites

You've modified the script.

This is the original.

#===============================================================================
# Skill Self Effects
# By Jet10985 (Jet)
# Requested by Touchfuzzy
#===============================================================================
# This script will allow you to specify a skill's effects tot arget the user
# instead of the target, on skills that don't already effect the user.
# This script has: 0 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: item_effect_apply
#===============================================================================
=begin
To specify the effects, use this notetag in the skill's notebox:
<self effect: 1>
or
<self effect: 1, 2, 3> to specify more than 1 effect
--------------------------------------------------------------------------------
Use of this script could be as the following.
You make a "Berserk Strike" skill, which does 200% damage to an enemy.
You make the 2nd effect "Defense Down 50%" and want it applied to the user.
You'd use this notetag: <self effect: 2>
=end
class RPG::Skill
  def self_effects
    if @self_effects.nil?
      @self_effects = []
      self.note.each_line {|a|
      scan = a.scan(/<self[ ]*effect[ ]*\:[ ]*(\d+(?:[ ]*,[ ]*\d+)*)>/i)
      begin
      scan[0][0].scan(/\d+/).each {|b|
      @self_effects.push(@effects[b.to_i - 1]) if b.to_i >= 1
      }
      rescue Exception => e
      end
      }
    end
    @self_effects
  end
end

class Game_Battler
  alias jet3745_item_effect_apply item_effect_apply
  def item_effect_apply(user, item, effect, reffed = false)
    if item.is_a?(RPG::Skill) && item.self_effects.include?(effect) && !reffed
      user.item_effect_apply(user, item, effect, true)
      return
    end
    jet3745_item_effect_apply(user, item, effect)
  end
end

 

Share this post


Link to post
Share on other sites

I copy and pasted it exact from the 3.5 example. Tried it and it failed. 
I eventually found this version online and it works. 

#===============================================================================
# Skill Self Effects
# By Jet10985 (Jet)
# Requested by Touchfuzzy
#===============================================================================
# This script will allow you to specify a skill's effects tot arget the user
# instead of the target, on skills that don't already effect the user.
# This script has: 0 customization options.
#===============================================================================
# Overwritten Methods:
# None
#-------------------------------------------------------------------------------
# Aliased methods:
# Game_Battler: item_effect_apply
#===============================================================================
=begin
To specify the effects, use this notetag in the skill's notebox:
<self effect: 1>
or
<self effect: 1, 2, 3> to specify more than 1 effect
--------------------------------------------------------------------------------
Use of this script could be as the following.
You make a "Berserk Strike" skill, which does 200% damage to an enemy.
You make the 2nd effect "Defense Down 50%" and want it applied to the user.
You'd use this notetag: <self effect: 2>
=end
class RPG::Skill
def self_effects
if @self_effects.nil?
@self_effects = []
self.note.each_line {|a|
scan = a.scan(/<self[ ]*effect[ ]*\:[ ]*(\d+(?:[ ]*,[ ]*\d+)*)>/i)
begin
scan[0][0].scan(/\d+/).each {|b|
@self_effects.push(@effects[b.to_i - 1]) if b.to_i >= 1
}
rescue Exception => e
end
}
end
@self_effects
end
end
class Game_Battler
alias jet3745_item_effect_apply item_effect_apply
def item_effect_apply(user, item, effect, reffed = false)
if item.is_a?(RPG::Skill) && item.self_effects.include?(effect) && !reffed
user.item_effect_apply(user, item, effect, true)
return
end
jet3745_item_effect_apply(user, item, effect)
end
end

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×