Ok, so I now read your thread again and see that I got it wrong. I made the events keep gliding between the two sprites on and on again, while you probably only wanted it to happen once and on a controlled trigger. Check this out though and tell me what I did wrong yourself so I don't make any further mistakes.
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# This class deals with events. It handles functions including event page
# switching via condition determinants, and running parallel process events.
# It's used within the Game_Map class.
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :alt_bitmap
attr_accessor :alt_opacity
#--------------------------------------------------------------------------
# * Object Initialization
# map_id : map ID
# event : event (RPG::Event)
#--------------------------------------------------------------------------
alias illuminate_initialize initialize
def initialize(map_id, event)
# Old
illuminate_initialize(map_id, event)
# Load custom graphics
if event.pages[0].list[0].parameters[0] == "ALT_GRAPHICS"
@alt_bitmap = Sprite.new
@alt_bitmap.bitmap = Bitmap.new( "Graphics/Characters/" + event.pages[0].list[1].parameters[0] )
@alt_bitmap.ox = (@alt_bitmap.bitmap.width / 4) / 2
@alt_bitmap.oy = (@alt_bitmap.bitmap.height / 4)
@alt_opacity = 0
@alt_bitmap.z = 99997
@alt_bitmap.src_rect.set(0, 0, 32, 48)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias illuminate_update update
def update
# Old
illuminate_update
# Change between graphics
@alt_opacity += 2 if @alt_opacity != nil
# Set the opacity
if @alt_opacity != nil
@alt_bitmap.opacity = @alt_opacity
@alt_bitmap.opacity = @alt_opacity - 255 if @alt_opacity > 255
@alt_bitmap.opacity = 255 - @alt_bitmap.opacity if @alt_opacity > 255
@alt_opacity = 0 if @alt_opacity > 500
# Set coordinates
@alt_bitmap.x = self.screen_x
@alt_bitmap.y = self.screen_y
# Source
@cw = @alt_bitmap.bitmap.width / 4
@ch = @alt_bitmap.bitmap.height / 4
sx = @pattern * @cw
sy = (@direction - 2) / 2 * @ch
@alt_bitmap.src_rect.set(sx, sy, @cw, @ch)
end
end
end
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
# This sprite is used to display the character.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias illuminate_update update
def update
# Old illuminate_update
illuminate_update
# Set opacity according to character
if @character.instance_of?(Game_Event) && @character.alt_opacity != nil
# Set the opacity
self.opacity = 255 - @character.alt_bitmap.opacity
end
end
end
Put this in a new script obviously, and to make an event have a second graphics, add a comment with the following as the FIRST command on the FIRST page of the event, looking like this:
ALT_GRAPHICS
001-Fighter01