设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2056|回复: 8
打印 上一主题 下一主题

[已经过期] 要如何修改这个脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
跳转到指定楼层
1
发表于 2015-3-26 18:35:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 是否使用精灵
  #--------------------------------------------------------------------------
  def use_sprite?
    true
  end
  #--------------------------------------------------------------------------
  # ● 战斗画面 X 坐标
  #--------------------------------------------------------------------------
  def screen_x
    Graphics.width / 2
  end
  #--------------------------------------------------------------------------
  # ● 战斗画面 Y 坐标
  #--------------------------------------------------------------------------
  def screen_y
    Graphics.height / 1
  end
  #--------------------------------------------------------------------------
  # ● 战斗画面 Z 坐标
  #--------------------------------------------------------------------------
  def screen_z
    return 100
  end
end
#==============================================================================
# ■ Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
  #--------------------------------------------------------------------------
  # ● 设置动画的原点
  #--------------------------------------------------------------------------
  def set_animation_origin
    if @animation.position == 3
    # 数据库中设定的动画基础位置是 [画面] 时的坐标变更
      @ani_ox = viewport.rect.width / 2
      yy = viewport.rect.height / 5
      @ani_oy = @battler.actor? ? (yy * 4) : (yy * 2.5)
    else
      @ani_ox = x - ox + width / 2
      @ani_oy = y - oy + height / 2
      if @animation.position == 0
        @ani_oy -= height / 2
      elsif @animation.position == 2
        @ani_oy += height / 2
      end
    end
  end
end


这个脚本的作用是让RMVA的默认战斗系统中的敌人显示技能动画。

经过我自己的修改后(就加了个1而已= =),敌人的技能动画会显示在画面中间。

但是我方人员对我方人员使用道具或者技能显示的动画则会显示在屏幕底端

因为不方便截图,所以希望哪位大神帮忙修改一下,谢谢。

PS 脚本的作者是谁我也忘了,找那个贴子也没找到,不好意思
PS 如果哪位大神有更好的脚本希望能够授予

Lv4.逐梦者

梦石
3
星屑
3605
在线时间
2492 小时
注册时间
2014-10-5
帖子
1768

开拓者剧作品鉴家

2
发表于 2015-3-27 10:38:59 | 只看该作者
RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Animation + (V1.5) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]https://atelierrgss.wordpress.com/[/url]
  6. #==============================================================================
  7. # - O script adiciona algumas funções extras para apresentar as animações
  8. # de batalha.
  9. #==============================================================================
  10. # Coloque as tags abaixo na caixa de notas das habilidades ou itens.
  11. #
  12. # ID = ID of Animation.
  13. #
  14. #------------------------------------------------------------------------------
  15. # ● HIT ANIMATION ●
  16. #
  17. # <Hit Animation = ID>
  18. #
  19. #------------------------------------------------------------------------------
  20. # ● USE ANIMATION (TYPE 1) ●
  21. #
  22. # <Use Animation = ID>
  23. #
  24. #------------------------------------------------------------------------------
  25. # ● USE ANIMATION (TYPE 2) ● (Wait for animation to complete)
  26. #
  27. # <Wait Use Animation = ID>
  28. #
  29. #------------------------------------------------------------------------------
  30. # ● STATES ANIMATION (LOOP) ● (States Tab)
  31. #
  32. # <Loop Animation = ID>
  33. #
  34. #------------------------------------------------------------------------------
  35. # ● DEATH ANIMATION ● (Enemy or Actor Tab)
  36. #
  37. # <Death Animation = ID>
  38. #
  39. #==============================================================================
  40. module MOG_ANIMATION_PLUS
  41.    # Defina aqui as IDs das animações que irão ignorar o tempo de espera
  42.    # para fluir a batalha, caso contrário o sistema de batalha vai
  43.    # esperar todas as animações sem excessão terminarem para poder prosseguir
  44.    # para o próximo estágio de batalha.
  45.    #
  46.    # É aconselhável colocar as animações das condições nesta opção para evitar
  47.    # que o sistema espere a animação do loop terminar.
  48.    #
  49.    IGNORE_WAIT_TIME_ANIMATION_ID = [1,69,109,114,115,116,117,118,119,120]
  50.  
  51.    #Velocidade de loop entre as animações.
  52.    STATES_LOOP_SPEED = 30
  53.  
  54.    #Definição da animação de level UP.
  55.    LEVEL_UP_ANIMATION = 37
  56. end
  57.  
  58. #==============================================================================
  59. # Atualizações desta versão.
  60. #============================================================================
  61. # (Ver 1.4) - Melhoria na compatibilidade com o script Battle Hud EX.
  62. #==============================================================================
  63.  
  64. $imported = {} if $imported.nil?
  65. $imported[:mog_animation_plus] = true
  66.  
  67. #==============================================================================
  68. # ■ Game Battler
  69. #==============================================================================
  70. class Game_Battler < Game_BattlerBase
  71.  
  72.   attr_accessor :animation_loop
  73.  
  74.   #--------------------------------------------------------------------------
  75.   # ● Initialize
  76.   #--------------------------------------------------------------------------
  77.   alias mog_animation_plus_initialize initialize
  78.   def initialize
  79.       mog_animation_plus_initialize
  80.       @animation_loop = []
  81.   end
  82.  
  83.   #--------------------------------------------------------------------------
  84.   # ● Add New State
  85.   #--------------------------------------------------------------------------               
  86.   alias mog_animation_plus_add_new_state add_new_state
  87.   def add_new_state(state_id)
  88.       mog_animation_plus_add_new_state(state_id)
  89.       check_loop_animation
  90.   end   
  91.  
  92.   #--------------------------------------------------------------------------
  93.   # ● Erase State
  94.   #--------------------------------------------------------------------------            
  95.   alias mog_animation_plus_erase_state erase_state
  96.   def erase_state(state_id)  
  97.       mog_animation_plus_erase_state(state_id)  
  98.       check_loop_animation
  99.   end  
  100.  
  101.   #--------------------------------------------------------------------------
  102.   # ● Check Loop Animation
  103.   #--------------------------------------------------------------------------               
  104.   def check_loop_animation
  105.       @animation_loop.clear
  106.       self.states.each_with_index do |i, index|
  107.       if i.note =~ /<Loop Animation = (\d+)>/i   
  108.          @animation_loop.push([$1.to_i,0, index + 1, true])
  109.       end
  110.       end
  111.   end
  112.  
  113.   #--------------------------------------------------------------------------
  114.   # ● Item Apply
  115.   #--------------------------------------------------------------------------           
  116.   alias mog_animation_plus_item_apply item_apply
  117.   def item_apply(user, item)
  118.       mog_animation_plus_item_apply(user, item)
  119.       execute_animation_plus_hit(item) if @result.success
  120.   end
  121.  
  122.   #--------------------------------------------------------------------------
  123.   # ● Execute Animation Plus Hit
  124.   #--------------------------------------------------------------------------           
  125.   def execute_animation_plus_hit(item)
  126.       return if item == nil
  127.       return if !SceneManager.scene_is?(Scene_Battle)
  128.       self.animation_id = $1.to_i if item.note =~ /<Hit Animation = (\d+)>/i   
  129.       if self.dead?
  130.          if self.is_a?(Game_Enemy)
  131.             battler = $data_enemies[self.enemy_id]
  132.          else
  133.             battler = $data_actors[self.id]
  134.          end  
  135.          self.animation_id = $1.to_i if battler.note =~ /<Death Animation = (\d+)>/i
  136.       end
  137.   end
  138.  
  139. end
  140.  
  141. #==============================================================================
  142. # ■ Sprite_Base
  143. #==============================================================================
  144. class Sprite_Base < Sprite  
  145.  
  146.   #--------------------------------------------------------------------------
  147.   # ● Battle Animation?
  148.   #--------------------------------------------------------------------------            
  149.   def battle_animation?
  150.       if @animation != nil
  151.          if MOG_ANIMATION_PLUS::IGNORE_WAIT_TIME_ANIMATION_ID.include?(@animation.id)
  152.             return false
  153.          end
  154.          return true         
  155.       end  
  156.       return false
  157.   end
  158.  
  159. end  
  160.  
  161.  
  162. #==============================================================================
  163. # ■ Sprite Battler
  164. #==============================================================================
  165. class Sprite_Battler < Sprite_Base
  166.  
  167.   #--------------------------------------------------------------------------
  168.   # ● Update Position
  169.   #--------------------------------------------------------------------------            
  170.   alias mog_animation_plus_update_position update_position
  171.   def update_position
  172.       mog_animation_plus_update_position
  173.       update_loop_animation if can_loop_animation?
  174.   end
  175.  
  176.   #--------------------------------------------------------------------------
  177.   # ● Can Loop Animation?
  178.   #--------------------------------------------------------------------------            
  179.   def can_loop_animation?
  180.       return false if BattleManager.in_turn?
  181.       return false if self.animation?
  182.       return false if @battler.animation_loop.empty? or @battler.dead?  
  183.       if $imported[:mog_battle_hud_ex]
  184.       return false if $game_message.visible and MOG_BATTLE_HUD_EX::MESSAGE_WINDOW_FADE_HUD
  185.       return false if !$game_temp.battle_hud_visible
  186.       end         
  187.       return true
  188.   end
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # ● Update Loop Animation
  192.   #--------------------------------------------------------------------------               
  193.   def update_loop_animation
  194.       for i in @battler.animation_loop
  195.           next if !i[3]
  196.           i[1] += 1
  197.           if i[1] >= MOG_ANIMATION_PLUS::STATES_LOOP_SPEED
  198.              i[1] = 0 ; @battler.animation_id = i[0] ; i[3] = false
  199.              if i[2] >= @battler.animation_loop.size
  200.                 for i in @battler.animation_loop
  201.                     i[1] = 0 ; i[3] = true
  202.                 end                 
  203.             end  
  204.           end
  205.           break           
  206.       end        
  207.   end
  208.  
  209.   #--------------------------------------------------------------------------
  210.   # ● Update Z Correction
  211.   #--------------------------------------------------------------------------                  
  212.   def update_z_correction
  213.       return if !@animation
  214.       @ani_sprites.each do |sprite| sprite.z = self.z + 1 end
  215.   end  
  216.  
  217. end
  218.  
  219. #==============================================================================
  220. # ■ Spriteset_Battle
  221. #==============================================================================
  222. class Spriteset_Battle
  223.  
  224.   #--------------------------------------------------------------------------
  225.   # ● Animation?
  226.   #--------------------------------------------------------------------------                     
  227.   def animation?
  228.       battler_sprites.any? {|sprite| sprite.battle_animation? }
  229.   end  
  230.  
  231. end
  232.  
  233. #==============================================================================
  234. # ■ Scene Battle
  235. #==============================================================================
  236. class Scene_Battle < Scene_Base
  237.  
  238.   #--------------------------------------------------------------------------
  239.   # ● Start
  240.   #--------------------------------------------------------------------------
  241.   alias mog_animation_plus_start start
  242.   def start
  243.       $game_party.members.each {|actor| actor.check_loop_animation }   
  244.       mog_animation_plus_start
  245.   end
  246.  
  247.   #--------------------------------------------------------------------------
  248.   # ● Use Item
  249.   #--------------------------------------------------------------------------         
  250.   alias mog_animation_plus_use_item use_item
  251.   def use_item
  252.       execute_cast_animation
  253.       mog_animation_plus_use_item        
  254.   end
  255.  
  256.   #--------------------------------------------------------------------------
  257.   # ● Execute Cast Animation
  258.   #--------------------------------------------------------------------------      
  259.   def execute_cast_animation
  260.       return if @subject.current_action.item == nil rescue return
  261.       item = @subject.current_action.item
  262.       if item.note =~ /<Use Animation = (\d+)>/i
  263.          execute_animation(@subject, $1.to_i,false)   
  264.       elsif item.note =~ /<Wait Use Animation = (\d+)>/i  
  265.          execute_animation(@subject, $1.to_i,true)   
  266.       end  
  267.   end  
  268.  
  269.   #--------------------------------------------------------------------------
  270.   # ● Execute Animation
  271.   #--------------------------------------------------------------------------     
  272.   def execute_animation(subject , anime_id = 0, wait_animation = false)
  273.       return if anime_id <= 0 or subject == nil
  274.       subject.animation_id = anime_id rescue nil
  275.       if wait_animation
  276.          duration = ($data_animations[anime_id].frame_max * 4) + 1
  277.          for i in 0..duration
  278.              @spriteset.update ; Graphics.update
  279.          end      
  280.       end   
  281.   end  
  282.  
  283. end   
  284.  
  285. #==============================================================================
  286. # ■ Game Actor
  287. #==============================================================================
  288. class Game_Actor < Game_Battler
  289.  
  290.   #--------------------------------------------------------------------------
  291.   # ● Level UP
  292.   #--------------------------------------------------------------------------      
  293.   alias mog_animation_plus_level_up level_up
  294.   def level_up
  295.        mog_animation_plus_level_up
  296.        self.animation_id = MOG_ANIMATION_PLUS::LEVEL_UP_ANIMATION if can_lvup_animation?
  297.   end
  298.  
  299.   #--------------------------------------------------------------------------
  300.   # ● Can Lvup Animation
  301.   #--------------------------------------------------------------------------      
  302.   def can_lvup_animation?
  303.       return false if !use_sprite?
  304.       return false if !SceneManager.scene_is?(Scene_Battle)
  305.       if $imported[:mog_battle_hud_ex]
  306.           return false if $game_message.visible and MOG_BATTLE_HUD_EX::MESSAGE_WINDOW_FADE_HUD
  307.           return false if !$game_temp.battle_hud_visible
  308.       end
  309.       return true
  310.   end
  311.  
  312. end


关于动画,貌似可以用这个。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
3
 楼主| 发表于 2015-3-27 18:22:54 手机端发表。 | 只看该作者
长弓巡洋集团 发表于 2015-3-27 10:38
#==============================================================================
# +++ MOG - Animatio ...

我试试先
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
4
 楼主| 发表于 2015-3-27 18:32:11 | 只看该作者
长弓巡洋集团 发表于 2015-3-27 10:38
#==============================================================================
# +++ MOG - Animatio ...

不好意思,没有效果
我用的是RMVA默认战斗系统

点评

在技能备注里写想要的动画,见脚本说明  发表于 2015-3-27 18:54
那个是要备注的 = =  发表于 2015-3-27 18:53
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
5
 楼主| 发表于 2015-3-29 04:48:26 | 只看该作者
长弓巡洋集团 发表于 2015-3-27 10:38
#==============================================================================
# +++ MOG - Animatio ...

原来如此,我再试试。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
6
 楼主| 发表于 2015-3-29 14:25:28 | 只看该作者
长弓巡洋集团 发表于 2015-3-27 10:38
#==============================================================================
# +++ MOG - Animatio ...

报告,实验失败!
失败原因:脚本不会,英语看不懂。

点评

那是葡萄牙語,不是英語  发表于 2015-3-29 14:32
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
7
 楼主| 发表于 2015-3-29 23:28:12 | 只看该作者
黑白色的枫 发表于 2015-3-29 14:25
报告,实验失败!
失败原因:脚本不会,英语看不懂。

葡萄牙语我也不认识QAQ

点评

我知道,我知道 PS:因为很重要所以说了两遍  发表于 2015-4-1 14:47
不要緊, 這是正常的==  发表于 2015-3-31 20:53
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
723
在线时间
530 小时
注册时间
2010-6-9
帖子
840
8
发表于 2015-3-31 11:11:10 | 只看该作者
把实验的流程和结果说下,或许能帮你解决问题。
失败是成功他妈。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
95
在线时间
62 小时
注册时间
2012-4-13
帖子
34
9
 楼主| 发表于 2015-3-31 19:28:01 | 只看该作者
负零 发表于 2015-3-31 11:11
把实验的流程和结果说下,或许能帮你解决问题。
失败是成功他妈。

我把
<Hit Animation = ID>
<Use Animation = ID>
<Wait Use Animation = ID>
<Loop Animation = ID>
<Death Animation = ID>
写在技能注释里,后面的ID替换成动画的序号
又在49行ID里写上了技能的序号,但是没有用
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-12 16:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表