查看: 1828|回复: 4

[已经解决] 关于修改战斗中显示角色特写效果的问题

[复制链接]

虚空人形

梦石
0
星屑
4866
在线时间
2037 小时
注册时间
2011-8-11
回帖
3260

贵宾

发表于 2013-11-19 09:00:14 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
以下这套脚本是在战斗中显示角色特写的(Pictures文件夹内命名为Actor+角色id的文件),
这里的图都是从画面左边进出的,我希望可以改成从右边进出,

我本来以为应该把59-80行的Initialize部分和115-134行的Update Slide部分的self.x值改掉即可,
但是无法达到预期效果。可以的话我还希望能够让这些文件放在一个单独的文件夹内。
  1. #==============================================================================
  2. # +++ MOG - ACTOR PICTURE CM  (v1.3) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com/
  6. #==============================================================================
  7. # Apresenta a imagem do personagem durante a seleção de comandos, com efeitos
  8. # animados.
  9. #==============================================================================
  10. # ● Definindo o nome das imagens dos battlers.
  11. #==============================================================================
  12. # 1 - As imagens devem ser gravadas na pasta
  13. #
  14. # GRAPHICS/PICTURES
  15. #
  16. # 2 - Nomeie os  arquivos de imagens da seguinte forma.
  17. #
  18. #
  19. # ACTOR + ID
  20. #
  21. # EG
  22. #
  23. # ACTOR1.png
  24. #
  25. #==============================================================================

  26. #==============================================================================
  27. # ● Histórico (Version History)
  28. #==============================================================================
  29. # v 1.3 - Melhoria na codificação.
  30. # v 1.2 - Ajuste automático da imagem do battler.
  31. # v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
  32. #         ações de que acertam todos os alvos.
  33. #==============================================================================

  34. module MOG_ACTOR_PICTURE_CM
  35.   #Posição da imagem do battler. (Para fazer ajustes)
  36.   PICTURE_POSITION = [0, 0]  
  37.   
  38.   #Definição da opacidade da imagem.
  39.   PICTURE_OPACITY = 255
  40.   
  41.   #Velocidade de deslize
  42.   SLIDE_SPEED = 30  
  43.   
  44.   #Ativar o efeito da imagem respirando.
  45.   BREATH_EFFECT = true
  46.   
  47.   #Definição da prioridade  da imagem na tela.
  48.   PICTURE_PRIORITY_Z = 103
  49. end

  50. #===============================================================================
  51. # ■ Sprite_Battler_CM
  52. #===============================================================================
  53. class Sprite_Battler_CM < Sprite
  54.   include MOG_ACTOR_PICTURE_CM
  55.   
  56.   #--------------------------------------------------------------------------
  57.   # ● Initialize
  58.   #--------------------------------------------------------------------------  
  59.   def initialize(viewport = nil,battler_id = -1)
  60.       super(viewport)
  61.       filename = "Actor" + battler_id.to_s
  62.       self.bitmap = Cache.picture(filename) rescue nil
  63.       self.bitmap = Cache.picture("") if self.bitmap == nil
  64.       sc = (544 / 2)  - (self.bitmap.width / 2) + PICTURE_POSITION[0]
  65.       @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]      
  66.       self.visible = false
  67.       self.opacity = 0
  68.       self.z = PICTURE_PRIORITY_Z
  69.       self.ox = 0
  70.       self.oy = self.bitmap.height
  71.       self.x = -@size[0]
  72.       self.y = (Graphics.height + 10) + PICTURE_POSITION[1]      
  73.       @breach_effect = [1.0,0]
  74.       @battler_id = battler_id
  75.       @active =  false
  76.       @cm_visible = false
  77.   end  
  78.   
  79.   #--------------------------------------------------------------------------
  80.   # ● Dispose
  81.   #--------------------------------------------------------------------------  
  82.   def dispose
  83.       super
  84.       self.bitmap.dispose
  85.   end
  86.   
  87.   #--------------------------------------------------------------------------
  88.   # ● Update
  89.   #--------------------------------------------------------------------------  
  90.   def update
  91.       super
  92.       update_slide
  93.   end  
  94.   
  95.   #--------------------------------------------------------------------------
  96.   # ● Active Battler
  97.   #--------------------------------------------------------------------------      
  98.   def active_battler(battler_id)
  99.       @active = @battler_id == battler_id ? true : false
  100.       self.visible = true if @active
  101.       @cm_visible = false if !@active
  102.   end
  103.   
  104.   #--------------------------------------------------------------------------
  105.   # ● Refresh Battler CM
  106.   #--------------------------------------------------------------------------        
  107.   def refresh_battler(cm_visible, battler_index)
  108.       @cm_visible = cm_visible
  109.       active_battler(battler_index)
  110.   end  
  111.   
  112.   #--------------------------------------------------------------------------
  113.   # ● Update Slide
  114.   #--------------------------------------------------------------------------  
  115.   def update_slide
  116.       if !@cm_visible
  117.            self.x -= SLIDE_SPEED if self.x > -@size[0]
  118.            self.opacity -= 25
  119.            if self.x <= -@size[0] or self.opacity == 0
  120.               self.visible = false
  121.               self.opacity = 0
  122.               self.x = -@size[0]
  123.            end   
  124.         else
  125.            self.x += SLIDE_SPEED if self.x < @size[1]
  126.            self.x = @size[1] if self.x > @size[1]
  127.            self.opacity += 10 if self.opacity < PICTURE_OPACITY
  128.            self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY
  129.            update_breath_effect
  130.       end         
  131.   end
  132.   
  133.   #--------------------------------------------------------------------------
  134.   # ● Update Breath Effect
  135.   #--------------------------------------------------------------------------   
  136.   def update_breath_effect
  137.       return if !BREATH_EFFECT
  138.       @breach_effect[1] += 1
  139.       case @breach_effect[1]
  140.          when 0..30
  141.              @breach_effect[0] += 0.0004
  142.          when 31..50
  143.              @breach_effect[0] -= 0.0004
  144.          else  
  145.          @breach_effect[1] = 0
  146.          @breach_effect[0] = 1.truncate
  147.       end
  148.       self.zoom_y = @breach_effect[0]
  149.   end  
  150.   
  151. end

  152. #===============================================================================
  153. # ■ Spriteset_Battle
  154. #===============================================================================
  155. class Spriteset_Battle
  156.   
  157.   #--------------------------------------------------------------------------
  158.   # ● Create Actors
  159.   #--------------------------------------------------------------------------   
  160.   alias mog_battler_cm_create_actors create_actors
  161.   def create_actors
  162.       mog_battler_cm_create_actors
  163.       create_battler_pictures
  164.   end
  165.   
  166.   #--------------------------------------------------------------------------
  167.   # ● Dispose
  168.   #--------------------------------------------------------------------------   
  169.   alias mog_battler_cm_dispose dispose
  170.   def dispose
  171.       mog_battler_cm_dispose
  172.       dispose_battler_cm
  173.   end  

  174.   #--------------------------------------------------------------------------
  175.   # ● Update
  176.   #--------------------------------------------------------------------------   
  177.   alias mog_battler_cm_update update
  178.   def update
  179.       mog_battler_cm_update
  180.       update_battler_cm
  181.   end   

  182.   #--------------------------------------------------------------------------
  183.   # ● Create Battler Pictures
  184.   #--------------------------------------------------------------------------   
  185.   def create_battler_pictures
  186.       @battler_pictures = []
  187.       for i in $game_party.battle_members
  188.           @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))
  189.       end   
  190.   end   
  191.   
  192.   #--------------------------------------------------------------------------
  193.   # ● Dispose Battler CM
  194.   #--------------------------------------------------------------------------   
  195.   def dispose_battler_cm
  196.       return if @battler_pictures == nil
  197.       @battler_pictures.each {|sprite| sprite.dispose }
  198.   end  

  199.   #--------------------------------------------------------------------------
  200.   # ● Update Battler CM
  201.   #--------------------------------------------------------------------------   
  202.   def update_battler_cm
  203.       return if @battler_pictures == nil
  204.       @battler_pictures.each {|sprite| sprite.update }
  205.   end   
  206.      
  207.   #--------------------------------------------------------------------------
  208.   # ● Update CM Pictures
  209.   #--------------------------------------------------------------------------      
  210.   def update_cm_picture(cm_visible, battler_index)
  211.       return if @battler_pictures == nil
  212.       @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }
  213.   end  
  214.   
  215. end

  216. #===============================================================================
  217. # ■ Scene_Battle
  218. #===============================================================================
  219. class Scene_Battle < Scene_Base
  220.   
  221.   #--------------------------------------------------------------------------
  222.   # ● Update
  223.   #--------------------------------------------------------------------------        
  224.   alias mog_cm_picture_update update
  225.   def update
  226.       mog_cm_picture_update  
  227.       update_picture_visible
  228.   end  
  229.   
  230.   #--------------------------------------------------------------------------
  231.   # ● Update Battler CM Active
  232.   #--------------------------------------------------------------------------      
  233.   def update_picture_visible
  234.       return if @actor_command_window == nil
  235.       cm_visible = can_cm_picture_visible?      
  236.       cm_id = BattleManager.actor.id rescue -1
  237.       @spriteset.update_cm_picture(cm_visible, cm_id)
  238.   end  
  239.   
  240.   #--------------------------------------------------------------------------
  241.   # ● Can CM Picture Visible
  242.   #--------------------------------------------------------------------------        
  243.   def can_cm_picture_visible?
  244.       return false if (@actor_window.active or @enemy_window.active) rescue return
  245.       return false if BattleManager.actor == nil      
  246.       return true
  247.   end  
  248.   
  249.   #--------------------------------------------------------------------------
  250.   # ● Execute Action
  251.   #--------------------------------------------------------------------------        
  252.   alias mog_cm_picture_execute_action execute_action
  253.   def execute_action
  254.       @spriteset.update_cm_picture(false, -1) if @spriteset != nil
  255.       mog_cm_picture_execute_action
  256.   end
  257.   
  258. end

  259. $mog_rgss3_actor_picture_cm = true
复制代码
梦石
0
星屑
34460
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

发表于 2013-11-19 09:41:58 | 显示全部楼层
不知道这样对不对,没试过

另存图片:在 Graphics 文件夹下新建一名为 Battleshot 的文件夹,图片全保存在里面。

改过的脚本:
  1. #==============================================================================
  2. # +++ MOG - ACTOR PICTURE CM  (v1.3) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com/
  6. #==============================================================================
  7. # Apresenta a imagem do personagem durante a seleção de comandos, com efeitos
  8. # animados.
  9. #==============================================================================
  10. # ● Definindo o nome das imagens dos battlers.
  11. #==============================================================================
  12. # 1 - As imagens devem ser gravadas na pasta
  13. #
  14. # GRAPHICS/PICTURES
  15. #
  16. # 2 - Nomeie os  arquivos de imagens da seguinte forma.
  17. #
  18. #
  19. # ACTOR + ID
  20. #
  21. # EG
  22. #
  23. # ACTOR1.png
  24. #
  25. #==============================================================================

  26. #==============================================================================
  27. # ● Histórico (Version History)
  28. #==============================================================================
  29. # v 1.3 - Melhoria na codificação.
  30. # v 1.2 - Ajuste automático da imagem do battler.
  31. # v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
  32. #         ações de que acertam todos os alvos.
  33. #==============================================================================

  34. module MOG_ACTOR_PICTURE_CM
  35.   #Posição da imagem do battler. (Para fazer ajustes)
  36.   PICTURE_POSITION = [0, 0]  
  37.   
  38.   #Definição da opacidade da imagem.
  39.   PICTURE_OPACITY = 255
  40.   
  41.   #Velocidade de deslize
  42.   SLIDE_SPEED = 30  
  43.   
  44.   #Ativar o efeito da imagem respirando.
  45.   BREATH_EFFECT = true
  46.   
  47.   #Definição da prioridade  da imagem na tela.
  48.   PICTURE_PRIORITY_Z = 103
  49. end
  50. #==============================================================================
  51. module Cache
  52.   def self.battleshot(filename)
  53.     load_bitmap("Graphics/Battleshot/", filename)
  54.   end
  55. end
  56. #===============================================================================
  57. # ■ Sprite_Battler_CM
  58. #===============================================================================
  59. class Sprite_Battler_CM < Sprite
  60.   include MOG_ACTOR_PICTURE_CM
  61.   
  62.   #--------------------------------------------------------------------------
  63.   # ● Initialize
  64.   #--------------------------------------------------------------------------  
  65.   def initialize(viewport = nil,battler_id = -1)
  66.       super(viewport)
  67.       filename = "Actor" + battler_id.to_s
  68.       self.bitmap = Cache.battleshot(filename) rescue nil
  69.       self.bitmap = Cache.battleshot("") if self.bitmap == nil
  70.       sc = (544 / 2)  + (self.bitmap.width / 2) + PICTURE_POSITION[0]
  71.       @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]      
  72.       self.visible = false
  73.       self.opacity = 0
  74.       self.z = PICTURE_PRIORITY_Z
  75.       self.ox = 0
  76.       self.oy = self.bitmap.height
  77.       self.x = Graphics.width #-@size[0]
  78.       self.y = (Graphics.height + 10) + PICTURE_POSITION[1]      
  79.       @breach_effect = [1.0,0]
  80.       @battler_id = battler_id
  81.       @active =  false
  82.       @cm_visible = false
  83.   end  
  84.   
  85.   #--------------------------------------------------------------------------
  86.   # ● Dispose
  87.   #--------------------------------------------------------------------------  
  88.   def dispose
  89.       super
  90.       self.bitmap.dispose
  91.   end
  92.   
  93.   #--------------------------------------------------------------------------
  94.   # ● Update
  95.   #--------------------------------------------------------------------------  
  96.   def update
  97.       super
  98.       update_slide
  99.   end  
  100.   
  101.   #--------------------------------------------------------------------------
  102.   # ● Active Battler
  103.   #--------------------------------------------------------------------------      
  104.   def active_battler(battler_id)
  105.       @active = @battler_id == battler_id ? true : false
  106.       self.visible = true if @active
  107.       @cm_visible = false if !@active
  108.   end
  109.   
  110.   #--------------------------------------------------------------------------
  111.   # ● Refresh Battler CM
  112.   #--------------------------------------------------------------------------        
  113.   def refresh_battler(cm_visible, battler_index)
  114.       @cm_visible = cm_visible
  115.       active_battler(battler_index)
  116.   end  
  117.   
  118.   #--------------------------------------------------------------------------
  119.   # ● Update Slide
  120.   #--------------------------------------------------------------------------  
  121.   def update_slide
  122.       if !@cm_visible
  123.            self.x += SLIDE_SPEED if self.x < Graphics.width
  124.            self.opacity -= 25
  125.            if self.x >= Graphics.width or self.opacity == 0
  126.               self.visible = false
  127.               self.opacity = 0
  128.               self.x = Graphics.width
  129.            end   
  130.         else
  131.            self.x -= SLIDE_SPEED if self.x > @size[1]
  132.            self.x = @size[1] if self.x < @size[1]
  133.            self.opacity += 10 if self.opacity < PICTURE_OPACITY
  134.            self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY
  135.            update_breath_effect
  136.       end         
  137.   end
  138.   
  139.   #--------------------------------------------------------------------------
  140.   # ● Update Breath Effect
  141.   #--------------------------------------------------------------------------   
  142.   def update_breath_effect
  143.       return if !BREATH_EFFECT
  144.       @breach_effect[1] += 1
  145.       case @breach_effect[1]
  146.          when 0..30
  147.              @breach_effect[0] += 0.0004
  148.          when 31..50
  149.              @breach_effect[0] -= 0.0004
  150.          else  
  151.          @breach_effect[1] = 0
  152.          @breach_effect[0] = 1.truncate
  153.       end
  154.       self.zoom_y = @breach_effect[0]
  155.   end  
  156.   
  157. end

  158. #===============================================================================
  159. # ■ Spriteset_Battle
  160. #===============================================================================
  161. class Spriteset_Battle
  162.   
  163.   #--------------------------------------------------------------------------
  164.   # ● Create Actors
  165.   #--------------------------------------------------------------------------   
  166.   alias mog_battler_cm_create_actors create_actors
  167.   def create_actors
  168.       mog_battler_cm_create_actors
  169.       create_battler_pictures
  170.   end
  171.   
  172.   #--------------------------------------------------------------------------
  173.   # ● Dispose
  174.   #--------------------------------------------------------------------------   
  175.   alias mog_battler_cm_dispose dispose
  176.   def dispose
  177.       mog_battler_cm_dispose
  178.       dispose_battler_cm
  179.   end  

  180.   #--------------------------------------------------------------------------
  181.   # ● Update
  182.   #--------------------------------------------------------------------------   
  183.   alias mog_battler_cm_update update
  184.   def update
  185.       mog_battler_cm_update
  186.       update_battler_cm
  187.   end   

  188.   #--------------------------------------------------------------------------
  189.   # ● Create Battler Pictures
  190.   #--------------------------------------------------------------------------   
  191.   def create_battler_pictures
  192.       @battler_pictures = []
  193.       for i in $game_party.battle_members
  194.           @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))
  195.       end   
  196.   end   
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # ● Dispose Battler CM
  200.   #--------------------------------------------------------------------------   
  201.   def dispose_battler_cm
  202.       return if @battler_pictures == nil
  203.       @battler_pictures.each {|sprite| sprite.dispose }
  204.   end  

  205.   #--------------------------------------------------------------------------
  206.   # ● Update Battler CM
  207.   #--------------------------------------------------------------------------   
  208.   def update_battler_cm
  209.       return if @battler_pictures == nil
  210.       @battler_pictures.each {|sprite| sprite.update }
  211.   end   
  212.      
  213.   #--------------------------------------------------------------------------
  214.   # ● Update CM Pictures
  215.   #--------------------------------------------------------------------------      
  216.   def update_cm_picture(cm_visible, battler_index)
  217.       return if @battler_pictures == nil
  218.       @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }
  219.   end  
  220.   
  221. end

  222. #===============================================================================
  223. # ■ Scene_Battle
  224. #===============================================================================
  225. class Scene_Battle < Scene_Base
  226.   
  227.   #--------------------------------------------------------------------------
  228.   # ● Update
  229.   #--------------------------------------------------------------------------        
  230.   alias mog_cm_picture_update update
  231.   def update
  232.       mog_cm_picture_update  
  233.       update_picture_visible
  234.   end  
  235.   
  236.   #--------------------------------------------------------------------------
  237.   # ● Update Battler CM Active
  238.   #--------------------------------------------------------------------------      
  239.   def update_picture_visible
  240.       return if @actor_command_window == nil
  241.       cm_visible = can_cm_picture_visible?      
  242.       cm_id = BattleManager.actor.id rescue -1
  243.       @spriteset.update_cm_picture(cm_visible, cm_id)
  244.   end  
  245.   
  246.   #--------------------------------------------------------------------------
  247.   # ● Can CM Picture Visible
  248.   #--------------------------------------------------------------------------        
  249.   def can_cm_picture_visible?
  250.       return false if (@actor_window.active or @enemy_window.active) rescue return
  251.       return false if BattleManager.actor == nil      
  252.       return true
  253.   end  
  254.   
  255.   #--------------------------------------------------------------------------
  256.   # ● Execute Action
  257.   #--------------------------------------------------------------------------        
  258.   alias mog_cm_picture_execute_action execute_action
  259.   def execute_action
  260.       @spriteset.update_cm_picture(false, -1) if @spriteset != nil
  261.       mog_cm_picture_execute_action
  262.   end
  263.   
  264. end

  265. $mog_rgss3_actor_picture_cm = true
复制代码
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

虚空人形

梦石
0
星屑
4866
在线时间
2037 小时
注册时间
2011-8-11
回帖
3260

贵宾

 楼主| 发表于 2013-11-19 09:59:33 | 显示全部楼层
芯☆淡茹水 发表于 2013-11-19 09:41
不知道这样对不对,没试过

另存图片:在 Graphics 文件夹下新建一名为 Battleshot 的文件夹,图片全保存在 ...

不行啊,直接连图片也看不见了。

点评

木有图片额~,完全不能试,只能瞎蒙。  发表于 2013-11-20 23:09
回复

使用道具 举报

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
回帖
2257

贵宾

发表于 2013-12-6 18:38:03 | 显示全部楼层
[pre lang="ruby" line="1"]#==============================================================================
# +++ MOG - ACTOR PICTURE CM  (v1.1) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# 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
#
#==============================================================================

#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
#         ações de que acertam todos os alvos.
#==============================================================================

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 = 101
end

#===============================================================================
# ■ 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 = Graphics.width/2  - bitmap.width/2 + PICTURE_POSITION[0]
      @size = [self.bitmap.width + PICTURE_POSITION[0], sc]      
      self.visible = false
      self.x = origin_x ###
      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
  ###
  def origin_x
    Graphics.width + @size[0]
  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 x < origin_x
           self.opacity -= 25
           if x >= origin_x || opacity == 0
              self.visible = false
              self.opacity = 0
              self.x = origin_x
           end   
        else
           if x > @size[1];    self.x -= SLIDE_SPEED
           elsif x < @size[1]; self.x = @size[1] end
           self.opacity += 10 if opacity < PICTURE_OPACITY
           self.opacity = PICTURE_OPACITY if 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]
  end  
  
end

#===============================================================================
# ■ 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) }
  end  
  
end

#===============================================================================
# ■ 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
  end  
  
  #--------------------------------------------------------------------------
  # ● Execute Action
  #--------------------------------------------------------------------------        
  alias mog_cm_picture_execute_action execute_action
  def execute_action
      @spriteset.update_cm_picture(false, -1) if @spriteset != nil
      mog_cm_picture_execute_action
  end
  
end

$mog_rgss3_actor_picture_cm = true[/pre]

改路径在62~64行

点评

hcm
知道了,谢谢。  发表于 2013-12-7 14:54
回复

使用道具 举报

虚空人形

梦石
0
星屑
4866
在线时间
2037 小时
注册时间
2011-8-11
回帖
3260

贵宾

 楼主| 发表于 2013-12-6 19:44:11 | 显示全部楼层
Sion 发表于 2013-12-6 18:38
#==============================================================================
# +++ MOG - ACTOR PI ...


追问一个问题,

现在确实是右边进入的,但是
我修改坐标的时候除了新问题,

我把57-78行改成了这样,希望战斗图直接靠在画面右下角:
  1.   #--------------------------------------------------------------------------
  2.   # ● Initialize
  3.   #--------------------------------------------------------------------------  
  4.   def initialize(viewport = nil,battler_id = -1)
  5.       super(viewport)
  6.       filename = "face" + battler_id.to_s
  7.       self.bitmap = Cache.picture(filename) rescue nil
  8.       self.bitmap = Cache.picture("") if self.bitmap == nil
  9.       sc = Graphics.width/2  - bitmap.width/2 + PICTURE_POSITION[0]
  10.       @size = [self.bitmap.width + PICTURE_POSITION[0], sc]      
  11.       self.visible = false
  12.       self.x = Graphics.width - self.bitmap.width #origin_x ###
  13.       self.y = Graphics.height - self.bitmap.height# + PICTURE_POSITION[1]
  14.       self.opacity = 0
  15.       self.z = PICTURE_PRIORITY_Z
  16.       self.ox = Graphics.width - self.bitmap.width#0
  17.       self.oy = Graphics.height - self.bitmap.height#self.bitmap.height
  18.       @breach_effect = [1.0,0]
  19.       @battler_id = battler_id
  20.       @active =  false
  21.       @cm_visible = false
  22.   end
复制代码
但是图片出现的位置有些怪,使用的公式为画面的长宽减去位图的长宽应该没错的吧。
另外,感觉图片进入好像有些延迟了。

点评

要改119行的 update_slide  发表于 2013-12-7 11:04
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部