you were missing addons :-/
here is Sprite_ActorCharGraphic
here is Sprite_ActorCharGraphic
Code:
#==============================================================================
# ** Sprite_ActorCharGraphic (V2.0) By Trickster
#-----------------------------------------------------------------------------
# A Sprite Class that represents an actor character graphic. Also Handles a few
# Graphical methods and animation. The Z coordinate is, by default,
# in between the window and its contents for easy integration in a window.
#==============================================================================
MACL::Loaded << 'Sprite_ActorCharGraphic'
class Sprite_ActorCharGraphic < Sprite
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :speed
attr_accessor :animate
attr_reader :frame
attr_reader :pose
#-------------------------------------------------------------------------
# * Name : Object Initialization
# Info : Creates a New Instance of this Class
# Author : Trickster
# Call Info : Three or Seven Arguments
# Game_Actor actor, Actor's Sprite to Display
# Integer X and Y, Position to Display
# Integer Speed, Speed of animation (Def 1)
# Integer Frame, Starting frame (Def. nil)
# String/Integer Pose, Pose Type/Pose Index (Def. nil)
# Viewport viewport, Viewport used (Def. nil)
#-------------------------------------------------------------------------
def initialize(actor, x, y, speed = 1, frame = 0, pose = 0, viewport = nil)
# Call Sprite#initialize and Send Viewport
super(viewport)
# Setup Instance Variables
@actor, @speed = actor, speed
# Setup Position
self.x = x
self.y = y
self.z = 101
# Setup Bitmap
self.bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
# Setup Other Variables
@name, @hue, @animate = @actor.character_name, @actor.character_hue, false
# Setup Pose if string sent
pose = MACL::Poses.index(pose) if pose.is_a?(String)
# Setup Pose and Frame
self.pose, self.frame = pose, frame
# Setup Counter Instance Variable
@count = 0
end
#-------------------------------------------------------------------------
# * Name : Set Graphic
# Info : Sets Graphic to (Frame, Pose)
# Author : Trickster
# Call Info : Two Arguments
# Integer Frame, Frame
# String/Integer Pose, Pose Type/Pose Index
#-------------------------------------------------------------------------
def set_graphic(pose, frame)
# Set Pose and Frame
self.pose, self.frame = pose, frame
end
#-------------------------------------------------------------------------
# * Name : Set Pose
# Info : Sets The Pose
# Author : Trickster
# Call Info : One Argument, String/Integer Pose Pose Type/Pose Index
#-------------------------------------------------------------------------
def pose=(pose)
# Turn pose into an integer if string sent
pose = MACL::Poses.index(pose) if pose.is_a?(String)
# Return if pose is nil or same pose
return if pose == nil or pose == @pose
# Set Y Coordinate of Source Rectangle
src_rect.y = bitmap.height / MACL::Poses.size * pose
# Set Height of Source Rectangle
src_rect.height = bitmap.height / MACL::Poses.size
# Set Pose
@pose = pose
end
#-------------------------------------------------------------------------
# * Name : Set Frame
# Info : Sets the Frame
# Author : Trickster
# Call Info : One Argument, Integer Frame, Frame to set
#-------------------------------------------------------------------------
def frame=(frame)
# Return if frame is nil or same frame
return if frame == nil or frame == @frame
# Set X Coordinate of Source Rectangle
src_rect.x = bitmap.width / MACL::Frames * frame
# Set Height of Source Rectangle
src_rect.width = bitmap.width / MACL::Frames
# Set Frame
@frame = frame
end
#-------------------------------------------------------------------------
# * Name : Frame Update
# Info : Update Animation if enabled, Updates Graphic
# Author : Trickster
# Call Info : No Arguments
#-------------------------------------------------------------------------
def update
# Call Sprite Update
super
# Update Graphic
update_graphic
# Return if not animated
return if not @animate or @speed == 0
# Increase Counter
@count += 1
# Return if speed frames have not passed
return if @count % @speed != 0
# Set Frame Restrict to [0, frames)
self.frame = (self.frame + 1) % MACL::Frames
end
#-------------------------------------------------------------------------
# * Name : Update Graphic (Private)
# Info : Private Method, Updates Actor Graphic
# Author : Trickster
# Call Info : No Arguements, can not be called outside this class
#-------------------------------------------------------------------------
private
def update_graphic
# Return if no changes made
return if @name == @actor.character_name and @hue == @actor.character_hue
# Update Name and Hue
@name, @hue = @actor.character_name, @actor.character_hue
# Set New Bitmap
self.bitmap = RPG::Cache.character(@name, @hue)
end
end