查看: 1855|回复: 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
星屑
34511
在线时间
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 | 显示全部楼层
  1. #==============================================================================
  2. # +++ MOG - ACTOR PICTURE CM  (v1.1) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  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.1 - Correção do bug de não apagar a imagem quando o battler usa
  30. #         ações de que acertam todos os alvos.
  31. #==============================================================================

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

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

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

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

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

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

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

  263. $mog_rgss3_actor_picture_cm = true
复制代码


改路径在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.

在本版发帖返回顶部