It figures.
😛
Okay, I updated the script within that post. And I included a simple header with a title now.
😛
But, if you're fine with doing an edit... replace the dispose method within my script with this upgraded version:
Code:
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
# The original code
lonezoom_spriteset_battle_dispose
# Dispose of secondary enemy sprites
unless @enemy_sprites2.nil?
for sprite in @enemy_sprites2
sprite.dispose unless sprite.nil?
end
end
end
The design adds two safeguards. It only performs this routine if the
@enemy_sprites2 array exists. And it only runs the
sprite.dispose command if the sprite actively exists.
HOWEVER, this must be placed below your animated battleback script. The effect is lost if you have it above the battleback script as the script you refer to as 'part 2' performs a rewrite of the Spriteset_Battle system's
initialize method.
SPECIAL ALERT:
The two scripts you presented: Part 1 and Part 2. I believe you have these in reverse order. The one labeled as Part 2 rewrites the
initialize method of the Spriteset_Battle class. But the one labeled as Part 1 attaches code to the same
initialize method in Spriteset_Battle. When your project runs, it will first see Part 1's
initialize method.... add the code... and then get to Part 2's initialize method and wipe everything added! If you reverse the order and have part 2 up higher, then it will run part 2's
initialize method and then add Part 1's code after. This is what's referred to as script order, and why you would also need to have mine below both.