Hey :)
I have problem with the Blizz-ABS (2.85) idle animation(enemy,Actor) i get this error:
" undefined method `-' for nil:NilClass "
and the marked error code:
#----------------------------------------------------------------------------
# sprite_animation_setup
# Processes the sprite-animation timing.
#----------------------------------------------------------------------------
def sprite_animation_setup
# if not Scene_Map, spriteset doesn't exist, not valid or no action sprites
if !$scene.is_a?(Scene_Map) || $scene.spriteset == nil || !valid? ||
!action_sprites?
# stop
return
end
# if defending
if @ai.act.defend?
# set spriteset name add-ons
@current_sprite, @weapon_sprite = BlizzABS::SPRDefend, ''
# set spriteset name
@character_name = @character_name_org + @current_sprite
# spriteset name add-on exists
elsif @current_sprite != '' && @character_name_org != ''
# decrease frame timer
@sframes[@sindex] -= 1 <----------------- HERE IS THE ERROR :o
# increase frame index if this frame is over
@sindex += 1 if @sframes[@sindex] <= 0
# if animation expired
if @sindex >= @sframes.size
# reset sprites
reset_sprites
# set the index back
@sindex = 0
else
# set spriteset name
@character_name = @character_name_org + @current_sprite
end
else
# reset sprites
reset_sprites
end
# if sprite extension doesn't exist already
if @current_sprite == '' && @character_name_org != ''
# set up movement sprite handling
sprite_movement_animation_setup
end
end
The code can be found in the Blizz-ABS part 3 at line 1222 hope someone can help me :(
Thanks ahead.
PS: Sorry for my bad english and greetings from Germany ;)
(Using RPGXP 102E)
I'm not sure what could be wrong; I don't think I've heard of this error before. Are you sure that all of your sprites are named correctly, and that you don't have sprites enabled that you don't use (idle sprites, running sprites, etc.)?
At the moment only Actor action sprites and idle sprites are enabled and i have all the sprites (_atk1, _wpn1, _idle,_idl....) :(
Quote from: hirasu on October 31, 2013, 06:07:08 pm
At the moment only Actor action sprites and idle sprites are enabled and i have all the sprites (_atk1, _wpn1, _idle,_idl....) :(
Oh, that is strange. I'm sorry that it's not working. :( Do you think that you could upload a small demo with the scripts and graphics that you are using so that someone can test it and see if they can figure out what is wrong? You don't need to upload your whole project if you don't want to - just one with the graphics and the scripts is all we need.
Here is a demo with my problem hope someone can fix this for me :(
Link1: http://www.workupload.com/file/cjn2aFKK
link2: http://www.megafileupload.com/en/file/465528/Idle-problem-rar.html
I recall this error being reported before. I can't remember the exact cause, and I know in 2.85 it was more of an issue than in 2.84.
I tested it with 2.84 and TaDa! its works for the Actor but the Enemy idle sprite are not displayed :???:
EDIT: I forgot to check the "Stop Animation" on the Event.
Hey, sorry if this topic is old but I managed to fix it in 2.85 by fiddling with the script.
In script 3, around line 1250~ removing the @current_sprite seemed to eliminate this error (at least for me). I don't know how legit this is and if it will fuck something up, but it's something.
Changed this
elsif self.idle? && idle_sprites?
@current_sprite = BlizzABS::SPRIdle
@character_name = @character_name_org + @current_sprite
To this
elsif self.idle? && idle_sprites?
@character_name = @character_name_org + BlizzABS::SPRIdle
Eliminating the use of @current_sprite on the other parts too (BlizzABS::SPRRunning for example) fixed them too.
This is the way it was in 2.84 I think. The weirdest thing is, when I used 2.85 for script parts 1 and 2 in conjunction of 2.84 part 3, the game didn't crash. Can someone explain what the hell is going on.
One more thing: the game crashed only when it tried to load the correct sprite. When _idl sprite didn't exist, it crashed because of that (unable to find graphic). When it was added to the game folder, it crashed for the nomethod error. Incase it matters