RPG Maker Forums

So I"m using Mogs Actor Picture Cm script for my battle system, and it works perfectly except the graphic is based on the actor id, and my actors change class.

I was wondering if it could be adjusted so the graphics are based on the id of the class, not the actor. Thanks!

Script:

Code:
#==============================================================================# +++ MOG - ACTOR PICTURE CM  (v1.0) +++#==============================================================================# By Moghunter# [URL="http://www.atelier-rgss.com/#==============================================================================%23"]http://www.atelier-rgss.com/#==============================================================================#[/URL] Apresenta a imagem do personagem durante a seleção de comandos, com efeitos# animados.#==============================================================================# ● Definindo o nome das imagens dos battlers.#==============================================================================# 1 - As imagens devem ser gravadas na pasta## GRAPHICS/PICTURES## 2 - Nomeie os  arquivos de imagens da seguinte forma.### ACTOR + ID## EG## ACTOR1.png##==============================================================================module MOG_ACTOR_PICTURE_CM  #Posição da imagem do battler. (Para fazer ajustes)  PICTURE_POSITION = [0, 0]  #Definição da opacidade da imagem.  PICTURE_OPACITY = 255  #Velocidade de deslize  SLIDE_SPEED = 30  #Ativar o efeito da imagem respirando.  BREATH_EFFECT = true  #Definição da prioridade  da imagem na tela.  PICTURE_PRIORITY_Z = 101end#===============================================================================# ■ Sprite_Battler_CM#===============================================================================class Sprite_Battler_CM < Sprite  include MOG_ACTOR_PICTURE_CM  #--------------------------------------------------------------------------  # ● Initialize  #--------------------------------------------------------------------------  def initialize(viewport = nil,battler_id = -1)	  super(viewport)	  filename = "Actor" + battler_id.to_s	  self.bitmap = Cache.picture(filename) rescue nil	  self.bitmap = Cache.picture("") if self.bitmap == nil	  sc = (544 / 2)  - (self.bitmap.width / 2) + PICTURE_POSITION[0]	  @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]		  self.visible = false	  self.x = -@size[0]	  self.y = self.bitmap.height + PICTURE_POSITION[1]	  self.opacity = 0	  self.z = PICTURE_PRIORITY_Z	  self.ox = 0	  self.oy = self.bitmap.height	  @breach_effect = [1.0,0]	  @battler_id = battler_id	  @active =  false	  @cm_visible = false  end  #--------------------------------------------------------------------------  # ● Dispose  #--------------------------------------------------------------------------  def dispose	  super	  self.bitmap.dispose  end  #--------------------------------------------------------------------------  # ● Update  #--------------------------------------------------------------------------  def update	  super	  update_slide  end  #--------------------------------------------------------------------------  # ● Active Battler  #--------------------------------------------------------------------------	  def active_battler(battler_id)	  @active = @battler_id == battler_id ? true : false	  self.visible = true if @active	  @cm_visible = false if !@active  end  #--------------------------------------------------------------------------  # ● Refresh Battler CM  #--------------------------------------------------------------------------	    def refresh_battler(cm_visible, battler_index)	  @cm_visible = cm_visible	  active_battler(battler_index)  end  #--------------------------------------------------------------------------  # ● Update Slide  #--------------------------------------------------------------------------  def update_slide	  if !@cm_visible		   self.x -= SLIDE_SPEED if self.x > -@size[0]		   self.opacity -= 25		   if self.x <= -@size[0] or self.opacity == 0			  self.visible = false			  self.opacity = 0			  self.x = -@size[0]		   end  		else		   self.x += SLIDE_SPEED if self.x < @size[1]		   self.x = @size[1] if self.x > @size[1]		   self.opacity += 10 if self.opacity < PICTURE_OPACITY		   self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY		   update_breath_effect	  end		  end  #--------------------------------------------------------------------------  # ● Update Breath Effect  #--------------------------------------------------------------------------    def update_breath_effect	  return if !BREATH_EFFECT	  @breach_effect[1] += 1	  case @breach_effect[1]		 when 0..30			 @breach_effect[0] += 0.0004		 when 31..50			 @breach_effect[0] -= 0.0004		 else		 @breach_effect[1] = 0		 @breach_effect[0] = 1.truncate	  end	  self.zoom_y = @breach_effect[0]  endend#===============================================================================# ■ Spriteset_Battle#===============================================================================class Spriteset_Battle  #--------------------------------------------------------------------------  # ● Create Actors  #--------------------------------------------------------------------------    alias mog_battler_cm_create_actors create_actors  def create_actors	  mog_battler_cm_create_actors	  create_battler_pictures  end  #--------------------------------------------------------------------------  # ● Dispose  #--------------------------------------------------------------------------    alias mog_battler_cm_dispose dispose  def dispose	  mog_battler_cm_dispose	  dispose_battler_cm  end  #--------------------------------------------------------------------------  # ● Update  #--------------------------------------------------------------------------    alias mog_battler_cm_update update  def update	  mog_battler_cm_update	  update_battler_cm  end    #--------------------------------------------------------------------------  # ● Create Battler Pictures  #--------------------------------------------------------------------------    def create_battler_pictures	  size = 0	  @battler_pictures = []	  for i in $game_party.members		  @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))		  size += 1		  break if size > 3	  end    end    #--------------------------------------------------------------------------  # ● Dispose Battler CM  #--------------------------------------------------------------------------    def dispose_battler_cm	  return if @battler_pictures == nil	  @battler_pictures.each {|sprite| sprite.dispose }  end  #--------------------------------------------------------------------------  # ● Update Battler CM  #--------------------------------------------------------------------------    def update_battler_cm	  return if @battler_pictures == nil	  @battler_pictures.each {|sprite| sprite.update }  end  	  #--------------------------------------------------------------------------  # ● Update CM Pictures  #--------------------------------------------------------------------------	  def update_cm_picture(cm_visible, battler_index)	  return if @battler_pictures == nil	  @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }  endend#===============================================================================# ■ Scene_Battle#===============================================================================class Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # ● Update  #--------------------------------------------------------------------------	    alias mog_cm_picture_update update  def update	  mog_cm_picture_update	  update_picture_visible  end  #--------------------------------------------------------------------------  # ● Update Battler CM Active  #--------------------------------------------------------------------------	  def update_picture_visible	  return if @actor_command_window == nil	  cm_visible = can_cm_picture_visible?		  cm_id = BattleManager.actor.id rescue -1	  @spriteset.update_cm_picture(cm_visible, cm_id)  end  #--------------------------------------------------------------------------  # ● Can CM Picture Visible  #--------------------------------------------------------------------------	    def can_cm_picture_visible?	  return false if (@actor_window.active or @enemy_window.active) rescue return	  return false if BattleManager.actor == nil	  return true  endend$mog_rgss3_actor_picture_cm = true

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top