Hey guys, I'm using NeoABS 1.5 by Mr.Mo.
I copies and psted the script with no problems, I also copied all the images.
But when I play the game, an error comes up:
Script ' o Player Process' Line 457 :NoMethodError Ocurred
undefined method `dash_lenght´for nil:NilClass
Help?
GAME SCRIPT
http://www.savefile.com/files/1364462
I copies and psted the script with no problems, I also copied all the images.
But when I play the game, an error comes up:
Script ' o Player Process' Line 457 :NoMethodError Ocurred
undefined method `dash_lenght´for nil:NilClass
Help?
Code:
#===============================================================================
# ** NeoABS - www.unknowncoders.com
#-------------------------------------------------------------------------------
# Author Mr.Mo "Muhammet Sivri"
# Version 1.0
# Date 11/25/07 (m/d/y)
#===============================================================================
module UCoders
class NeoABS
#-----------------------------------------------------------------------------
# * Player Update
#-----------------------------------------------------------------------------
def update_player
$game_player.update_states
#Keep the current party leader updated
actor = $game_party.actors[0]
#Update click time
@button_mash -= 1 if @button_mash > 0; return if @button_mash > 0
# Check Defend key
if CAN_DEFEND && Input.press?(DEFEND_KEY)
return player_defend
else
actor.guarding = false
end
return if $game_temp.message_window_showing
#Check Ranged attack
if Input.trigger?(Attack_Key) || Input.press?(Attack_Key)
#Check State Effect
$game_party.actors[0].states.each { |id| return if STUN_EFFECT.include?(id) || PARALAYZE_EFFECT.include?(id) }
return player_range if Range_Weapons.has_key?(actor.weapon_id); return player_melee
end
return if @enemies.empty?
#Check for Skill attacks
actor.skill_keys.each_key { |key| next if actor.skill_keys[key].nil? || actor.skill_keys[key] == 0 || !Input.trigger?(key)
$game_party.actors[0].states.each { |id| return if STUN_EFFECT.include?(id) || PARALAYZE_EFFECT.include?(id) || MUTE_EFFECT.include?(id) }
id = actor.skill_keys[key]
return player_explode(id) if Range_Explode.has_key?(id); return player_skill(id)}
#Check Item
check_item
end
#--------------------------------------------------------------------------
# * Player Ranged Attack
#--------------------------------------------------------------------------
def player_range
actor = $game_party.actors[0]
#Get the weapon
w = Range_Weapons[actor.weapon_id]
#Return if the ammo isn't there
return if w[3] != 0 && $game_party.item_number(w[3]) == 0
$game_player.animation_id = $data_weapons[actor.weapon_id].animation1_id
#Add mash time
@button_mash = (w[5].nil? ? Default_Mash*10 : w[5]*10)
#Delete an ammo
$game_party.lose_item(w[3], 1) if w[3] != 0
#Make the attack
@range.push(Game_Ranged_Weapon.new($game_player, actor, actor.weapon_id))
#Animate
return if w[7].nil?
animate($game_player, w[7].to_s,w[8]) if Player_Animation
end
#--------------------------------------------------------------------------
# * Player Melee Attack
#--------------------------------------------------------------------------
def player_melee
actor = $game_party.actors[0]
return if $data_weapons[actor.weapon_id].nil?
#Get all enemies
@enemies.each_value { |e|
#Skip NIL values || dead enemies
next if e.nil? || e.dead?
#Skip the enemy if its not close by || not facing
next if !$game_player.in_direction?(e.event) || !$game_player.in_range?(e.event, 1)
# Skip if the enemy is an ally && can't hurt allies.
next if !Can_Hurt_Ally && !e.hate_group.include?(0)
# Show Weapon Aniamtion
$game_player.animation_id = $data_weapons[actor.weapon_id].animation1_id
#Add mash time
m = Melee_Custom[actor.weapon_id]
if !m.nil? && !m[0].nil?
@button_mash = m[0]*10
else
@button_mash = Default_Mash*10
end
#Attack the enemy
e.effect_attack(actor)
#Get Animation
a = $data_weapons[actor.weapon_id].animation2_id
# Hit enemy if the attack succeeds
if e.behavior(1).include?(6)
hit_enemy(e, actor, a) if e.damage != "Miss"
e.damage = nil
else
hit_enemy(e, actor, a) if e.damage != "Miss"
end
#Jump
jump(e.event, $game_player, Melee_Custom[actor.weapon_id][1]) if Melee_Custom[actor.weapon_id] != nil && e.damage != "Miss"
#Animate the player
if Melee_Custom[actor.weapon_id] != nil && Melee_Custom[actor.weapon_id][2].nil?
animate($game_player, "_melee") if Player_Animation
elsif Melee_Custom[actor.weapon_id] != nil
m = Melee_Custom[actor.weapon_id]
animate($game_player, m[2].to_s,m[3]) if Player_Animation
end
# Increase Combo
$game_player.combo_hit(1,@button_mash) if UCoders::Allow_Combo_Display && e.damage != "Miss"
#Return if the enemy is dead
return if enemy_dead?(e,actor)
#Set the new target for the enemy
e.battle_setup(0)
}
end
#--------------------------------------------------------------------------
# * Player Defend
#--------------------------------------------------------------------------
def player_defend
actor = $game_party.actors[0]
actor.guarding = true
@Default_Mash = DEFEND_MASH
animate($game_player,DEFEND_ANIMATION.to_s) if Player_Animation
end
#--------------------------------------------------------------------------
# * Player Skill Attack
#--------------------------------------------------------------------------
def player_skill(id)
actor = $game_party.actors[0]
#Get Skill
skill = $data_skills[id]
#Return if the skill doesn't exist
return if skill.nil? || !actor.skills.include?(skill.id) || !actor.can_use_skill?(skill)
# Show Animation
$game_player.animation_id = skill.animation1_id
#Animate
if Skill_Custom.has_key?(id)
l = Skill_Custom[id]
animate($game_player, l[2].to_s,l[3]) if Player_Animation
else
animate($game_player, "_cast") if Player_Animation
end
id = skill.id
#Activate Common Event
if skill.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = skill.common_event_id
end
#Get the skill scope
case skill.scope
when 1 # Enemy
# If the skill is ranged
if Range_Skills.has_key?(skill.id)
# Add to range
@range.push(Game_Ranged_Skill.new($game_player, actor, skill))
# Take off SP
actor.sp -= skill.sp_cost
w = Range_Skills[id]
# Add mash time
return @button_mash = (w[3].nil? ? Default_Mash*10 : w[3]*10)
end
if !Skill_Custom[id].nil?
@button_mash = (Skill_Custom[id].nil? ? Default_Mash*10 : Skill_Custom[id] != nil && Skill_Custom[id][0] != nil ? Skill_Custom[id][0]*10 : Default_Mash*10)
else
@button_mash = Default_Mash*10
end
# If the skill is not ranged
enemies = []
# Get all enemies
@enemies.each_value { |enemy| next if enemy.nil? or enemy.dead? or (!enemy.hate_group.include?(0) && !Can_Hurt_Ally) or !UCoders.in_screen?(enemy.event)
enemies.push(enemy) }
e = $game_player
# Order them from closest to the farthest
enemies.sort! {|a,b|
get_range(e.event,a.event) - get_range(e.event,b.event) }
# Return if enemies = nil
return if enemies[0].nil?
# Attack the closest one
enemies[0].effect_skill(actor, skill)
# Take off SP
actor.sp -= skill.sp_cost
# Show Animetion on enemy
if enemies[0].behavior(1).include?(6)
hit_enemy(enemies[0], actor, skill.animation2_id) if enemies[0].damage != "Miss"
enemies[0].damage = nil
else
hit_enemy(enemies[0], actor, skill.animation2_id) if enemies[0].damage != "Miss"
end
e = enemies[0]
jump(e.event, $game_player, Skill_Custom[id][1]) if Skill_Custom[id] != nil && e.damage != "Miss"
# Return if enemy is dead
return if enemy_dead?(enemies[0],actor)
# If its alive, put it in battle
return enemies[0].battle_setup(0)
when 2 # All Emenies
# Play the animation on player
$game_player.animation_id = skill.animation2_id
# Take off SP
actor.sp -= skill.sp_cost
id = skill.id
# If the skill is ranged
if Range_Skills.has_key?(skill.id)
enemies = get_all_range($game_player, Range_Skills[skill.id][0])
w = Range_Skills[id]
# Add mash time
@button_mash = (w[3].nil? ? Default_Mash*10 : w[3]*10)
else
if Skill_Custom[id] != nil
@button_mash = (Skill_Custom[id].nil? ? Default_Mash*10 : Skill_Custom[id] != nil && Skill_Custom[id][0] != nil ? Skill_Custom[id][0]*10 : Default_Mash*10)
else
@button_mash = Default_Mash*10
end
enemies = @enemies
end
return if enemies.nil? || enemies.empty?
#Get all enemies
enemies.each_value { |e| next if e.nil? or e.dead? or (!Can_Hurt_Ally && e.hate_group.include?(0) or !UCoders.in_screen?(enemy.event))
#Attack enemy
e.effect_skill(actor, skill)
#Show Animetion on enemy
if er.behavior(1).include?(6)
hit_enemy(e, actor, 0) if e.damage != "Miss"
jump(e.event, $game_player, Skill_Custom[id][1]) if Skill_Custom[id] != nil && e.damage != "Miss"
e.damage = nil
else
hit_enemy(e, actor, 0) if e.damage != "Miss"
jump(e.event, $game_player, Skill_Custom[id][1]) if Skill_Custom[id] != nil && e.damage != "Miss"
end
#Skip this enemy if its dead
next if enemy_dead?(e,actor)
return e.battle_setup(0) }
when 3..4, 7 #User
if Skill_Custom[id] != nil
@button_mash = (Skill_Custom[id].nil? ? Default_Mash*10 : Skill_Custom[id] != nil && Skill_Custom[id][0] != nil ? Skill_Custom[id][0]*10 : Default_Mash*10)
else
@button_mash = Default_Mash*10
end
#Use the skill on the player
actor.effect_skill(actor, skill)
#Take off SP
actor.sp -= skill.sp_cost
#Play animation
return $game_player.animation_id = skill.animation2_id
end
end
#--------------------------------------------------------------------------
# * Player Explode Attack
#--------------------------------------------------------------------------
def player_explode(id)
actor = $game_party.actors[0]
#Get Skill
skill = $data_skills[id]
#Return if the skill doesn't exist
return if skill.nil? || !actor.skills.include?(skill.id) || !actor.can_use_skill?(skill)
w = Range_Explode[skill.id]
# Show Animation
$game_player.animation_id = skill.animation1_id
#Add mash time
@button_mash = (w[4] == nil ? MASH_TIME*10 : w[4]*10)
#Animate
if Skill_Custom.has_key?(id)
l = Skill_Custom[id]
animate($game_player,l[2].to_s,l[3]) if Player_Animation
else
animate($game_player,"_cast") if Player_Animation
end
#Add to range
@range.push(Game_Ranged_Explode.new($game_player, actor, skill))
#Take off SP
return actor.sp -= skill.sp_cost
end
#--------------------------------------------------------------------------
# * Check Item
#--------------------------------------------------------------------------
def check_item
actor = $game_party.actors[0]
#Check for item usage
$game_player.item_keys.each_key { |key|
next if $game_player.item_keys[key].nil? || $game_player.item_keys[key] == 0 || !Input.trigger?(key)
$game_party.actors[0].states.each { |i| return if STUN_EFFECT.include?(i) }
item = $data_items[$game_player.item_keys[key]]
return $game_system.se_play($data_system.buzzer_se) if !$game_party.item_can_use?(item.id) && (!item.is_a?(RPG::Weapon) || !item.is_a?(RPG::Armor))
# If items are used up; Play buzzer SE
return $game_system.se_play($data_system.buzzer_se) if $game_party.item_number(item.id) == 0
# Case Typ
case item
when RPG::Item
# If effect scope is an ally
if item.scope >= 3
# Apply item use effects to target actor
target = $game_party.actors[0]
used = target.item_effect(item)
# If an item was used
if used
#Show animation on player
$game_player.animation_id = item.animation1_id
# Play item use SE
$game_system.se_play(item.menu_se)
# If consumable; Decrease used items by 1
$game_party.lose_item(item.id, 1) if item.consumable
$game_player.item_keys[key] = 0 if $game_party.item_number(item.id) == 0
# If all party members are dead; Switch to game over screen
return game_over(true) if $game_party.all_dead?
# If common event ID is valid; Common event call reservation
return $game_temp.common_event_id = item.common_event_id if item.common_event_id > 0
# If effect scope is other than an ally
end
else
# If command event ID is valid
if item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = item.common_event_id
# Play item use SE
$game_system.se_play(item.menu_se)
# If consumable; Decrease used items by 1
$game_party.lose_item(item.id, 1) if item.consumable
$game_player.item_keys[key] = 0 if $game_party.item_number(item.id) == 0
end
end
when RPG::Weapon
# Save old equipment
#actor.equip(0, item.nil? ? 0 : item.id)
when RPG::Armor
#actor.equip(, item == nil ? 0 : item.id)
end
}
end
#--------------------------------------------------------------------------
# * Revive Actor
#--------------------------------------------------------------------------
def revive_actor
items = []
# Get the item that revives
$game_party.items.each_key { |i|
next if $game_party.items[i] == 0 || $game_party.items[i].nil?
item = $data_items[i]
next if !item.minus_state_set.include?(Death_State_ID) || item.scope < 3
items.push(i)
}
# If list is empty
if items.empty? or !Revive
game_over(false)
else
i = rand(items.size)
item = $data_items[items[i]]
# If effect scope is an ally
if item.scope >= 3
# Apply item use effects to target actor
target = $game_party.actors[0]
used = target.item_effect(item)
# If an item was used
if used
#Show animation on player
@animation_id = item.animation1_id
# Play item use SE
$game_system.se_play(item.menu_se)
# If consumable; Decrease used items by 1
$game_party.lose_item(item.id, 1) if item.consumable
# If all party members are dead; Switch to game over screen
return game_over(true) if $game_party.all_dead?
# If common event ID is valid; Common event call reservation
return $game_temp.common_event_id = item.common_event_id if item.common_event_id > 0
# If effect scope is other than an ally
end
else
# If command event ID is valid
if item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = item.common_event_id
# Play item use SE
$game_system.se_play(item.menu_se)
# If consumable; Decrease used items by 1
$game_party.lose_item(item.id, 1) if item.consumable
end
end
end
end
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) && refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
attr_accessor :attacking_id, :skill_keys, :guarding, :enemy_id
#-----------------------------------------------------------------------------
# * Setup
#-----------------------------------------------------------------------------
alias mrmo_abs_game_actor_setup setup
def setup(actor_id)
mrmo_abs_game_actor_setup(actor_id)
@attacking_id = -UCoders::Max_Actors
@skill_keys = UCoders::Skill_Keys
@guarding = false
@enemy_id = 0
end
#-----------------------------------------------------------------------------
# * Get Range
#-----------------------------------------------------------------------------
def get_range(object)
x = (event.x - object.x) * (event.x - object.x)
y = (event.y - object.y) * (event.y - object.y)
r = x + y
r = Math.sqrt(r)
return r.to_i
end
#-----------------------------------------------------------------------------
# * Behavior
#-----------------------------------------------------------------------------
def behavior(r=0)
return []
end
#--------------------------------------------------------------------------
# * Get its current enemy
#--------------------------------------------------------------------------
def my_enemy
id = @attacking_id; return (id <= 0 ? $game_party.actors[id.abs] : $NeoABS.enemies[id])
end
#-----------------------------------------------------------------------------
# * Event
#-----------------------------------------------------------------------------
def event; return $game_player; end
#--------------------------------------------------------------------------
# * Setup(e_id) - Sets up against new enemy
#--------------------------------------------------------------------------
def battle_setup(e_id)
# Set Up Enemy
@attacking_id = e_id
end
#--------------------------------------------------------------------------
# * Restore the Movement Type(Enemy)
#--------------------------------------------------------------------------
def restore_setup
@attacking_id = -UCoders::Max_Actors
end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants && map scrolling. Refer to "$game_player" for the one
# instance of this class.
#==============================================================================
class Game_Player
#-----------------------------------------------------------------------------
# * Instance Variables
#-----------------------------------------------------------------------------
attr_reader :dashing, :sneaking, :sneak_min, :dash_min
attr_accessor :movable, :attacking_id, :fade, :item_keys
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super
@dashing = @sneaking = false
@movable = true
@mold_speed = 0
@dash_min = $NeoABS.dash_lenght*10
@sneak_min = $NeoABS.sneak_lenght*10
@attacking_id = -UCoders::Max_Actors
@fade = false
@item_keys = UCoders::Item_Keys # Hotkeys for items
end
#--------------------------------------------------------------------------
# * ID
#--------------------------------------------------------------------------
def id; return 0; end
def actor; return $game_party.actors[0]; end
def event; return self; end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias mrmo_game_player_update update
def update
update_dash if $NeoABS.allow_dash
update_sneak if $NeoABS.allow_sneak
mrmo_game_player_update
end
#--------------------------------------------------------------------------
# * Update States(Frame)
#--------------------------------------------------------------------------
def update_states
# For Player
actor.states.each { |id| next if !UCoders::States.has_key?(id); state = UCoders::States[id]; next if state == 0
add_state_effect(state,id) if actor.state_time == 0
actor.state_time += 1
if actor.state_time >= state
$game_party.actors[0].remove_state(id)
actor.state_time = 0
return remove_state_effects(id)
end
update_states_effects(id)
}
if actor.hp > 0 && actor.slip_damage? && (Graphics.frame_count % 40) == 0 && !moving?
actor.hp -= [actor.maxhp / 100, 1].max
if actor.hp == 0
$game_system.se_play($data_system.actor_collapse_se)
if UCoders::Next_Leader && !$game_party.all_dead?
$NeoABS.move_forward
else
$NeoABS.revive_actor
end
end
$game_screen.start_flash(Color.new(255,0,0,128), 4)
end
end
#--------------------------------------------------------------------------
# * Add State Effect(State, ID)
#--------------------------------------------------------------------------
def add_state_effect(state,id)
if UCoders::DAZZLE_EFFECT.include?(id)
$game_screen.start_tone_change(Tone.new(200, 200, 130, 0), 20)
elsif UCoders::BLIND_EFFECT.include?(id)
$game_screen.start_tone_change(Tone.new(-200,-200,-200, 0), 50)
elsif UCoders::STUN_EFFECT.include?(id)
@movable = false
elsif UCoders::SLEEP_EFFECT.include?(id)
@movable = false
elsif UCoders::PARALAYZE_EFFECT.include?(id)
if @sneaking || @dashing
@move_speed = @mold_speed
@sneaking = @dashing = false
end
@mold_speed = @move_speed
elsif UCoders::DELAY_EFFECT.include?(id)
if @sneaking || @dashing
@move_speed = @mold_speed
@sneaking = @dashing = false
end
@mold_speed = @move_speed
end
end
#--------------------------------------------------------------------------
# * Update State Effect(State, ID)
#--------------------------------------------------------------------------
def update_states_effects(id)
if UCoders::PARALAYZE_EFFECT.include?(id)
@move_speed = 1
elsif UCoders::DELAY_EFFECT.include?(id)
@move_speed = 2
elsif UCoders::SPEED_UP.include?(id)
@dash_min = $NeoABS.dash_lenght*10
elsif UCoders::LIGHT_FEET.include?(id)
@sneak_min = $NeoABS.sneak_lenght*10
end
end
#--------------------------------------------------------------------------
# * Removve State Effect(State, ID)
#--------------------------------------------------------------------------
def remove_state_effects(id)
if UCoders::STUN_EFFECT.include?(id)
@movable = true
elsif UCoders::DAZZLE_EFFECT.include?(id)
$game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 50)
elsif UCoders::BLIND_EFFECT.include?(id)
$game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 50)
elsif UCoders::SLEEP_EFFECT.include?(id)
@movable = true
elsif UCoders::PARALAYZE_EFFECT.include?(id)
@move_speed = @mold_speed
elsif UCoders::DELAY_EFFECT.include?(id)
@move_speed = @mold_speed
end
end
#--------------------------------------------------------------------------
# * Update Dash
#--------------------------------------------------------------------------
def update_dash
if Input.press?(UCoders::Dash_Key) && @dash_min > 0 && !@sneaking && @movable
$game_party.actors[0].states.each { |id|
return if UCoders::CLUMSY_EFFECT.include?(id) || UCoders::PARALAYZE_EFFECT.include?(id) || UCoders::DELAY_EFFECT.include?(id) }
if moving?
@mold_speed = @move_speed if !@dashing
@character_name = "#{@character_name}#{_dashing}" if !@dashing && UCoders::Dash_Animation_Show
@dashing = true
@move_speed = $NeoABS.dash_speed
@dash_min -= 1
else
@dash_min += 1 if @dash_min < $NeoABS.dash_lenght*10
end
elsif @dashing || (@dash_min <= 0 && @dashing)
@dashing = false
@move_speed = @mold_speed if !@sneaking
@character_name = @character_name.sub(/#{_dashing}/){} if UCoders::Dash_Animation_Show
else
@dash_min += 1 if @dash_min < $NeoABS.dash_lenght*10
end
end
#--------------------------------------------------------------------------
# * Update Sneak
#--------------------------------------------------------------------------
def update_sneak
if !@dashing && Input.press?(UCoders::Sneak_Key) &;;& @sneak_min > 0 && @movable
#Check State Effect
$game_party.actors[0].states.each { |id|
return if UCoders::CLUMSY_EFFECT.include?(id) || UCoders::PARALAYZE_EFFECT.include?(id) || UCoders::DELAY_EFFECT.include?(id)}
if moving?
@mold_speed = @move_speed if !@sneaking
self.character_name = "#{@character_name}#{SNEAK_ANIMATION}" if !@sneaking && UCoders::Sneak_Animation_Show
@sneaking = true
@move_speed = $NeoABS.sneak_speed
@sneak_min -= 1
else
@sneak_min += 1 if @sneak_min < $NeoABS.sneak_lenght*10
end
elsif @sneaking || (@sneak_min <= 0 && @sneaking)
@sneaking = false
@move_speed = @mold_speed if !@dashing
self.character_name = @character_name.sub(/#{SNEAK_ANIMATION}/){} if UCoders::Sneak_Animation_Show
else
@sneak_min += 1 if @sneak_min < $NeoABS.sneak_lenght*10
end
end
#--------------------------------------------------------------------------
# * Player Movement Update
#--------------------------------------------------------------------------
alias mrmo_abs_game_player_moving? moving?
def moving?
return true if !@movable
super
mrmo_abs_game_player_moving?
end
end
GAME SCRIPT
http://www.savefile.com/files/1364462