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

Project1

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

[已经过期] 这个脚本状态动画怎么弄一直循环 不闪烁 攻击时候也一直...

[复制链接]

Lv1.梦旅人

梦石
0
星屑
208
在线时间
152 小时
注册时间
2011-4-22
帖子
52
跳转到指定楼层
1
发表于 2015-11-6 00:03:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这个脚本状态动画怎么弄一直循环 不闪烁 攻击时候也一直... {:4_130:}

RUBY 代码复制
  1. #==============================================================================
  2. # +++ MOG - Animation (1.5) +++
  3. # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. #  By Moghunter
  5. #  [url]http://www.atelier-rgss.com/RGSS/RGSS_VX_ACE.html[/url]
  6. #==============================================================================
  7. # 使数据库中的动画用途更广
  8. #==============================================================================
  9. # 写在技能、物品、状态的备注中 ID = 动画ID
  10. # ----------------------------------------
  11. # ● 命中动画 ●
  12. #   <Hit Animation = ID> 当攻击命中目标后的动画
  13. # ----------------------------------------
  14. # ● 启动动画① ●
  15. #   <Use Animation = ID> 攻击前的动画 可以理解为准备动作
  16. #                        此动画以使用者自己为目标 可以设计成攻击动作
  17. # ----------------------------------------
  18. # ● 启动动画② ●
  19. #   <Wait Use Animation = ID> 播放完启动动画后才会显示技能动画
  20. # ----------------------------------------
  21. # ● 状态动画<循环> ●
  22. #   <Loop Animation = ID> 写在状态备注中 当附加了此状态后会循环播放的动画
  23. # ----------------------------------------
  24. # ● 死亡动画 ●
  25. #   <Death Animation = ID> 濒死时播放的动画
  26. #==============================================================================
  27. module MOG_ANIMATION_PLUS
  28.   # 忽略等待时间的动画ID。
  29.   IGNORE_WAIT_TIME_ANIMATION_ID = [
  30.     1, 3, 21, 50,
  31.  
  32.   999]
  33.  
  34.   # 状态动画循环速度
  35.   STATES_LOOP_SPEED = 30
  36.  
  37.   # 升级动画
  38.   LEVEL_UP_ANIMATION = 2
  39. end
  40. #==============================================================================
  41. $imported = {} if $imported.nil?
  42. $imported[:mog_animation_plus] = true
  43. #==============================================================================
  44. # ■ Game Battler
  45. #==============================================================================
  46. class Game_Battler < Game_BattlerBase
  47.   attr_accessor :animation_loop
  48.   #--------------------------------------------------------------------------
  49.   # ● Initialize
  50.   #--------------------------------------------------------------------------
  51.   alias mog_animation_plus_initialize initialize
  52.   def initialize
  53.       mog_animation_plus_initialize
  54.       @animation_loop = []
  55.   end
  56.   #--------------------------------------------------------------------------
  57.   # ● Add New State
  58.   #--------------------------------------------------------------------------
  59.   alias mog_animation_plus_add_new_state add_new_state
  60.   def add_new_state(state_id)
  61.       mog_animation_plus_add_new_state(state_id)
  62.       check_loop_animation
  63.   end   
  64.   #--------------------------------------------------------------------------
  65.   # ● Erase State
  66.   #--------------------------------------------------------------------------
  67.   alias mog_animation_plus_erase_state erase_state
  68.   def erase_state(state_id)  
  69.       mog_animation_plus_erase_state(state_id)  
  70.       check_loop_animation
  71.   end  
  72.   #--------------------------------------------------------------------------
  73.   # ● Check Loop Animation
  74.   #--------------------------------------------------------------------------
  75.   def check_loop_animation
  76.       @animation_loop.clear
  77.       self.states.each_with_index do |i, index|
  78.       if i.note =~ /<Loop Animation = (\d+)>/i   
  79.          @animation_loop.push([$1.to_i,0, index + 1, true])
  80.       end
  81.       end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● Item Apply
  85.   #--------------------------------------------------------------------------
  86.   alias mog_animation_plus_item_apply item_apply
  87.   def item_apply(user, item)
  88.       mog_animation_plus_item_apply(user, item)
  89.       execute_animation_plus_hit(item) if @result.success
  90.   end
  91.   #--------------------------------------------------------------------------
  92.   # ● Execute Animation Plus Hit
  93.   #--------------------------------------------------------------------------
  94.   def execute_animation_plus_hit(item)
  95.       return if item == nil
  96.       return if !SceneManager.scene_is?(Scene_Battle)
  97.       self.animation_id = $1.to_i if item.note =~ /<Hit Animation = (\d+)>/i   
  98.       if self.dead?
  99.          if self.is_a?(Game_Enemy)
  100.             battler = $data_enemies[self.enemy_id]
  101.          else
  102.             battler = $data_actors[self.id]
  103.          end  
  104.          self.animation_id = $1.to_i if
  105.                              battler.note =~ /<Death Animation = (\d+)>/i
  106.       end
  107.   end
  108. end
  109. #==============================================================================
  110. # ■ Sprite_Base
  111. #==============================================================================
  112. class Sprite_Base < Sprite  
  113.   #--------------------------------------------------------------------------
  114.   # ● Battle Animation?
  115.   #--------------------------------------------------------------------------
  116.   def battle_animation?
  117.       if @animation != nil
  118.          if MOG_ANIMATION_PLUS::
  119.             IGNORE_WAIT_TIME_ANIMATION_ID.include?(@animation.id)
  120.             return false
  121.          end
  122.          return true         
  123.       end  
  124.       return false
  125.   end
  126. end  
  127. #==============================================================================
  128. # ■ Sprite Battler
  129. #==============================================================================
  130. class Sprite_Battler < Sprite_Base
  131.   #--------------------------------------------------------------------------
  132.   # ● Update Position
  133.   #--------------------------------------------------------------------------
  134.   alias mog_animation_plus_update_position update_position
  135.   def update_position
  136.       mog_animation_plus_update_position
  137.       update_loop_animation if can_loop_animation?
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● Can Loop Animation?
  141.   #--------------------------------------------------------------------------
  142.   def can_loop_animation?
  143.       return false if BattleManager.in_turn?
  144.       return false if self.animation?
  145.       return false if @battler.animation_loop.empty? or @battler.dead?  
  146.       if $imported[:mog_battle_hud_ex]
  147.       return false if
  148.          $game_message.visible and MOG_BATTLE_HUD_EX::MESSAGE_WINDOW_FADE_HUD
  149.       return false if !$game_temp.battle_hud_visible
  150.       end         
  151.       return true
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● Update Loop Animation
  155.   #--------------------------------------------------------------------------
  156.   def update_loop_animation
  157.       for i in @battler.animation_loop
  158.           next if !i[3]
  159.           i[1] += 1
  160.           if i[1] >= MOG_ANIMATION_PLUS::STATES_LOOP_SPEED
  161.              i[1] = 0 ; @battler.animation_id = i[0] ; i[3] = false
  162.              if i[2] >= @battler.animation_loop.size
  163.                 for i in @battler.animation_loop
  164.                     i[1] = 0 ; i[3] = true
  165.                 end                 
  166.             end  
  167.           end
  168.           break           
  169.       end        
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● Update Z Correction
  173.   #--------------------------------------------------------------------------
  174.   def update_z_correction
  175.       return if !@animation
  176.       @ani_sprites.each do |sprite| sprite.z = self.z + 1 end
  177.   end  
  178. end
  179. #==============================================================================
  180. # ■ Spriteset_Battle
  181. #==============================================================================
  182. class Spriteset_Battle
  183.   #--------------------------------------------------------------------------
  184.   # ● Animation?
  185.   #--------------------------------------------------------------------------
  186.   def animation?
  187.       battler_sprites.any? {|sprite| sprite.battle_animation? }
  188.   end  
  189. end
  190. #==============================================================================
  191. # ■ Scene Battle
  192. #==============================================================================
  193. class Scene_Battle < Scene_Base
  194.   #--------------------------------------------------------------------------
  195.   # ● Start
  196.   #--------------------------------------------------------------------------
  197.   alias mog_animation_plus_start start
  198.   def start
  199.       $game_party.members.each {|actor| actor.check_loop_animation }   
  200.       mog_animation_plus_start
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● Use Item
  204.   #--------------------------------------------------------------------------
  205.   alias mog_animation_plus_use_item use_item
  206.   def use_item
  207.       execute_cast_animation
  208.       mog_animation_plus_use_item        
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● Execute Cast Animation
  212.   #--------------------------------------------------------------------------
  213.   def execute_cast_animation
  214.       return if @subject.current_action.item == nil rescue return
  215.       item = @subject.current_action.item
  216.       if item.note =~ /<Use Animation = (\d+)>/i
  217.          execute_animation(@subject, $1.to_i,false)   
  218.       elsif item.note =~ /<Wait Use Animation = (\d+)>/i  
  219.          execute_animation(@subject, $1.to_i,true)   
  220.       end  
  221.   end  
  222.   #--------------------------------------------------------------------------
  223.   # ● Execute Animation
  224.   #--------------------------------------------------------------------------
  225.   def execute_animation(subject , anime_id = 0, wait_animation = false)
  226.       return if anime_id <= 0 or subject == nil
  227.       subject.animation_id = anime_id rescue nil
  228.       if wait_animation
  229.          duration = ($data_animations[anime_id].frame_max * 4) + 1
  230.          for i in 0..duration
  231.              @spriteset.update ; Graphics.update
  232.          end      
  233.       end   
  234.   end  
  235. end   
  236. #==============================================================================
  237. # ■ Game Actor
  238. #==============================================================================
  239. class Game_Actor < Game_Battler
  240.   #--------------------------------------------------------------------------
  241.   # ● Level UP
  242.   #--------------------------------------------------------------------------
  243.   alias mog_animation_plus_level_up level_up
  244.   def level_up
  245.        mog_animation_plus_level_up
  246.        self.animation_id = MOG_ANIMATION_PLUS::LEVEL_UP_ANIMATION if
  247.                            can_lvup_animation?
  248.   end
  249.   #--------------------------------------------------------------------------
  250.   # ● Can Lvup Animation
  251.   #--------------------------------------------------------------------------
  252.   def can_lvup_animation?
  253.       return false if !use_sprite?
  254.       return false if !SceneManager.scene_is?(Scene_Battle)
  255.       if $imported[:mog_battle_hud_ex]
  256.           return false if $game_message.visible and
  257.                           MOG_BATTLE_HUD_EX::MESSAGE_WINDOW_FADE_HUD
  258.           return false if !$game_temp.battle_hud_visible
  259.       end
  260.       return true
  261.   end
  262. end

Lv1.梦旅人

梦石
0
星屑
61
在线时间
251 小时
注册时间
2015-5-14
帖子
453
2
发表于 2015-11-6 18:50:02 | 只看该作者
什么鬼,你想问的是什么【・ヘ・?】
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

3
发表于 2015-11-7 23:07:13 | 只看该作者
这个好像是这段脚本无法避免的问题,可以试试我下面这个脚本。

评分

参与人数 1星屑 +20 收起 理由
午睡的风铃 + 20 我很赞同

查看全部评分

用头画头像,用脚写脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
208
在线时间
152 小时
注册时间
2011-4-22
帖子
52
4
 楼主| 发表于 2015-11-8 21:55:15 | 只看该作者
KB.Driver 发表于 2015-11-7 23:07
这个好像是这段脚本无法避免的问题,可以试试我下面这个脚本。

[fold]#================================= ...

你这个脚本怎么用???
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

5
发表于 2015-11-9 18:08:55 | 只看该作者
lqly10 发表于 2015-11-8 21:55
你这个脚本怎么用???

看上面的注释:
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
# <state ani: x>
# Causes the status effect to play battle animation x repeatedly on the battler
# if the battler is affected by this state and if this state is the highest
# priority state with an animation.
#
#==============================================================================
用头画头像,用脚写脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
208
在线时间
152 小时
注册时间
2011-4-22
帖子
52
6
 楼主| 发表于 2015-11-9 22:32:16 | 只看该作者
KB.Driver 发表于 2015-11-9 18:08
看上面的注释:
# -----------------------------------------------------------------------------
# S ...

亲啊  我小学没有毕业  郁闷 看不懂英文  有没有范例  或者教我怎么设置 怎么用  

点评

……用百度翻译一句一句翻大概就能整明白个差不多了吧……别告诉我你不会复制粘贴……  发表于 2015-11-10 08:06
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
208
在线时间
152 小时
注册时间
2011-4-22
帖子
52
7
 楼主| 发表于 2015-11-10 13:15:48 | 只看该作者
lqly10 发表于 2015-11-9 22:32
亲啊  我小学没有毕业  郁闷 看不懂英文  有没有范例  或者教我怎么设置 怎么用   ...


试过了  多数翻译不了  翻译出来什么国家  数据 就没有了
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

8
发表于 2015-11-10 13:43:56 | 只看该作者
lqly10 发表于 2015-11-9 22:32
亲啊  我小学没有毕业  郁闷 看不懂英文  有没有范例  或者教我怎么设置 怎么用   ...

比如,你希望在附加了2号状态时在角色身上显示1号动画。
就在状态002的备注栏里写上:
<state ani: 1>

情形拓展一下就是:
你希望在附加了Y号状态时在角色身上显示X号动画。
就在状态Y的备注栏里写上:
<state ani: X>
用头画头像,用脚写脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
208
在线时间
152 小时
注册时间
2011-4-22
帖子
52
9
 楼主| 发表于 2015-11-11 00:15:33 | 只看该作者
KB.Driver 发表于 2015-11-10 13:43
比如,你希望在附加了2号状态时在角色身上显示1号动画。
就在状态002的备注栏里写上:

为什么我的用不了  求解http://pan.baidu.com/s/1c0wjazI
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1883
在线时间
157 小时
注册时间
2016-1-29
帖子
267
10
发表于 2018-12-5 11:15:11 | 只看该作者
KB.Driver 发表于 2015-11-10 13:43
比如,你希望在附加了2号状态时在角色身上显示1号动画。
就在状态002的备注栏里写上:

KB哥 我复制了也没有用啊?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 13:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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