I'm using Prexus' Sketch script in my game and, for some reason, whenever I use an attacking item against the enemy, this message pops up:
Script 'Sketch' line 157:NoMethodError occured.
undefined method 'scope' for 1:Fixnum
The script is:
If anyone can help me with this, I'll owe you big time. Thank you! ^^
Script 'Sketch' line 157:NoMethodError occured.
undefined method 'scope' for 1:Fixnum
The script is:
Code:
#------------------
# Sketch
# by Prexus
# Mimics the ability Sketch by Relm in Final Fantasy 6
# Randomly selects one of the monster's abilities and uses it
# http://rm-dev.org/
#------------------
class Scene_Battle
# Set the ID of the Sketch skill here:
$SKETCH_ID = 81
# Do not edit any of the following:
def make_skill_action_result
# Get skill
@skill = $data_skills[@active_battler.current_action.skill_id]
if @skill.id == $SKETCH_ID
set_target_battlers(@skill)
for target in @target_battlers
enemy = $data_enemies[target.id]
skills = []
for i in 0...enemy.actions.size
if enemy.actions[i].kind = 1
if enemy.actions[i].condition_level <= @active_battler.level
skills.push($data_skills[enemy.actions[i].skill_id])
end
end
end
if skills.size != 0
# Randomly picks an enemy's skill
@skill = skills[rand(skills.size)-1]
else
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
end
# If not a forcing action
unless @active_battler.current_action.forcing
# If unable to use due to SP running out
unless @active_battler.skill_can_use?(@skill.id)
# Clear battler being forced into action
$game_temp.forcing_battler = nil
# Shift to step 1
@phase4_step = 1
return
end
end
# Use up SP
if skills != nil
skills = []
skills = nil
@target_battlers = []
sketch = true
else
@active_battler.sp -= @skill.sp_cost
sketch = false
end
# Refresh status window
@status_window.refresh
# Show skill name on help window
@help_window.set_text(@skill.name, 1)
# Set animation ID
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# Set command event ID
@common_event_id = @skill.common_event_id
# Set target battlers
set_target_battlers(@skill, sketch)
# Apply skill effect
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
alias stb set_target_battlers
def set_target_battlers(skill, sketch = false)
if sketch
if @active_battler.is_a?(Game_Enemy)
case skill.scope
when 1
index = rand($game_party.actors.size)-1
@target_battlers.push($game_party.smooth_target_actor(index))
when 2
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 3
index = rand($game_troop.enemies.size)-1
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 4
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 5
index = rand($game_troop.enemies.size)-1
enemy = $game_troop.enemies[index]
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
when 6
for enemy in $game_troop.enemies
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
end
when 7
@target_battlers.push(@active_battler)
end
end
if @active_battler.is_a?(Game_Actor)
case skill.scope
when 1
index = rand($game_troop.enemies.size)-1
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 2
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 3
index = rand($game_party.actors.size)-1
@target_battlers.push($game_party.smooth_target_actor(index))
when 4
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 5
index = rand($game_party.actors.size)-1
actor = $game_party.actors[index]
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
when 6
for actor in $game_party.actors
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
end
when 7
@target_battlers.push(@active_battler)
end
end
return
end
stb(skill.scope)
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Determine if Skill can be Used
# skill_id : skill ID
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
#if not skill_learn?(skill_id)
# return false
#end
return super
end
end
If anyone can help me with this, I'll owe you big time. Thank you! ^^