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

Project1

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

[已经过期] 关于动画播放时自动向下方移动的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
461 小时
注册时间
2010-6-28
帖子
467
跳转到指定楼层
1
发表于 2014-1-30 13:54:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  1. *#==============================================================================
  2. # +++ MOG - Simple Movement System (v1.2) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # Sistema simples de movimento na diagonal e dash.
  8. #==============================================================================
  9. # Sprite Dash (Opcional)
  10. #==============================================================================
  11. # Nomei o sprite do personagem da seguinte forma.
  12. #
  13. # Character Name + _Dash.png
  14. #
  15. # EX
  16. #
  17. # Aluxes_Dash.png
  18. #
  19. #==============================================================================

  20. #===============================================================================
  21. # ■ Histórico (Version History)
  22. #===============================================================================
  23. # v1.1 Corrigido o bug de não verificar o nome do personagem ao adiciona-lo ou
  24. # remove-lo.
  25. #===============================================================================

  26. module MOG_SIMPLE_MOVEMENT_SYSTEM
  27. #Definição do botão de correr.
  28. DASH_BUTTON = Input::A
  29. #Definição da velocidade normal
  30. NORMAL_SPEED = 3.8
  31. #Definição da velocidade do dash
  32. DASH_SPEED = 4.8
  33. end

  34. #===============================================================================
  35. # ■ Character
  36. #===============================================================================
  37. class Game_Character < Game_CharacterBase
  38. include MOG_SIMPLE_MOVEMENT_SYSTEM

  39. attr_accessor :dash_sprite

  40. #--------------------------------------------------------------------------
  41. # ● Dash Sprite
  42. #--------------------------------------------------------------------------
  43. alias mog_character_dash_sprite_initialize initialize
  44. def initialize
  45. @dash_sprite = [false,false,nil]
  46. mog_character_dash_sprite_initialize
  47. end

  48. #--------------------------------------------------------------------------
  49. # ● Check Dash Sprite
  50. #--------------------------------------------------------------------------
  51. def check_dash_sprite
  52. return if @dash_sprite[0]
  53. @dash_sprite[0] = true
  54. @dash_sprite[1] = true if RPG_FileTest.character_exist?(@character_name + "_Dash")
  55. @dash_sprite[4] = @character_name + "_Dash" if @dash_sprite[1]
  56. end

  57. #--------------------------------------------------------------------------
  58. # ● Check RealName
  59. #--------------------------------------------------------------------------
  60. def check_real_name
  61. return if @dash_sprite[3] != nil
  62. return if @character_name == ""
  63. @dash_sprite[3] = @character_name
  64. end

  65. #--------------------------------------------------------------------------
  66. # ● Reset Dash Parameter
  67. #--------------------------------------------------------------------------
  68. def reset_dash_parameter
  69. @dash_sprite = [false,false,nil]
  70. check_dash_sprite
  71. check_real_name
  72. end

  73. #--------------------------------------------------------------------------
  74. # ● Update Dash Sprite Name
  75. #--------------------------------------------------------------------------
  76. def update_dash_sprite_name(original_name = true)
  77. if $schala_battle_system
  78. return if $game_temp.battle_phase[0]
  79. return if self.battler != nil and self.battler.dead?
  80. end
  81. return if !@dash_sprite[1]
  82. if original_name
  83. @character_name = @dash_sprite[3]
  84. else
  85. @character_name = @dash_sprite[4]
  86. end
  87. end

  88. end

  89. #===============================================================================
  90. # ■ Game_CharacterBase
  91. #===============================================================================
  92. class Game_CharacterBase

  93. #--------------------------------------------------------------------------
  94. # ● Set Graphic
  95. #--------------------------------------------------------------------------
  96. alias mog_simple_movement_set_graphic set_graphic
  97. def set_graphic(character_name, character_index)
  98. mog_simple_movement_set_graphic(character_name, character_index)
  99. reset_dash_sprite_name if self.is_a?(Game_Player) or self.is_a?(Game_Follower)
  100. end

  101. #--------------------------------------------------------------------------
  102. # ● Rest Dash Sprite
  103. #--------------------------------------------------------------------------
  104. def reset_dash_sprite_name
  105. self.reset_dash_parameter
  106. end

  107. end

  108. #==============================================================================
  109. # ■ Game Party
  110. #==============================================================================
  111. class Game_Party < Game_Unit

  112. #--------------------------------------------------------------------------
  113. # ● Swap Order
  114. #--------------------------------------------------------------------------
  115. alias mog_simple_movement_swap_order swap_order
  116. def swap_order(index1, index2)
  117. mog_simple_movement_swap_order(index1, index2)
  118. $game_player.reset_dash_parameter
  119. for f in $game_player.followers
  120. f.reset_dash_parameter
  121. end
  122. $game_player.refresh
  123. end

  124. #--------------------------------------------------------------------------
  125. # ● Reset Party Name
  126. #--------------------------------------------------------------------------
  127. def reset_party_dash_name
  128. $game_player.reset_dash_parameter
  129. for i in $game_player.followers
  130. i.reset_dash_parameter
  131. end
  132. end

  133. #--------------------------------------------------------------------------
  134. # ● Add Actor
  135. #--------------------------------------------------------------------------
  136. alias mog_simple_movement_add_actor add_actor
  137. def add_actor(actor_id)
  138. mog_simple_movement_add_actor(actor_id)
  139. reset_party_dash_name
  140. end

  141. #--------------------------------------------------------------------------
  142. # ● Remove Actor
  143. #--------------------------------------------------------------------------
  144. alias mog_simple_movement_remove_actor remove_actor
  145. def remove_actor(actor_id)
  146. mog_simple_movement_remove_actor(actor_id)
  147. reset_party_dash_name
  148. end

  149. #--------------------------------------------------------------------------
  150. # ● Change Leader
  151. #--------------------------------------------------------------------------
  152. alias mog_simple_movement_change_leader change_leader
  153. def change_leader
  154. mog_simple_movement_change_leader
  155. reset_party_dash_name
  156. end

  157. #--------------------------------------------------------------------------
  158. # ● Refresh Leader
  159. #--------------------------------------------------------------------------
  160. alias mog_simple_movement_refresh_leader refresh_leader
  161. def refresh_leader
  162. mog_simple_movement_refresh_leader
  163. reset_party_dash_name
  164. end

  165. end

  166. #==============================================================================
  167. # ■ Game Interpreter
  168. #==============================================================================
  169. class Game_Interpreter

  170. #--------------------------------------------------------------------------
  171. # ● Command 322
  172. #--------------------------------------------------------------------------
  173. alias mog_simple_movement_system_command_322 command_322
  174. def command_322
  175. mog_simple_movement_system_command_322
  176. actor = $game_actors[@params[0]]
  177. if @params[0] == 1
  178. $game_player.reset_dash_parameter rescue nil
  179. else
  180. f_id = @params[0] - 2
  181. $game_player.followers[f_id].reset_dash_parameter rescue nil
  182. end
  183. $game_player.refresh
  184. end

  185. end

  186. #==============================================================================
  187. # ■ Game_Player
  188. #==============================================================================
  189. class Game_Player < Game_Character
  190. attr_accessor :dash

  191. #--------------------------------------------------------------------------
  192. # ● Initialize
  193. #--------------------------------------------------------------------------
  194. alias mog_dash_sprite_player_initialize initialize
  195. def initialize
  196. [url=home.php?mod=space&uid=81012]@Dash[/url] = false
  197. mog_dash_sprite_player_initialize
  198. end

  199. #--------------------------------------------------------------------------
  200. # ● Refresh
  201. #--------------------------------------------------------------------------
  202. alias mog_dash_sprite_refresh refresh
  203. def refresh
  204. mog_dash_sprite_refresh
  205. check_dash_sprite
  206. check_real_name
  207. end

  208. #--------------------------------------------------------------------------
  209. # ● Dash?
  210. #--------------------------------------------------------------------------
  211. alias mog_simple_movement_dash dash?
  212. def dash?
  213. return false
  214. mog_simple_movement_dash
  215. end

  216. #--------------------------------------------------------------------------
  217. # ● Can Dash?
  218. #--------------------------------------------------------------------------
  219. def can_dash?
  220. return true if Input.press?(DASH_BUTTON)
  221. return false
  222. end

  223. #--------------------------------------------------------------------------
  224. # ● Update Dash Command
  225. #--------------------------------------------------------------------------
  226. def update_dash_button
  227. @dash = false
  228. @move_speed = NORMAL_SPEED
  229. update_dash_sprite_name(true)
  230. return unless can_dash?
  231. @dash = true
  232. update_dash_sprite_name(false)
  233. @move_speed = DASH_SPEED
  234. @anime_count -= 0.5 if moving?
  235. end

  236. #--------------------------------------------------------------------------
  237. # ● Move By Input
  238. #--------------------------------------------------------------------------
  239. def move_by_input
  240. return unless can_move_by_input_dash?
  241. update_dash_button
  242. case Input.dir8
  243. when 2,4,6,8; move_straight(Input.dir4)
  244. when 1; execute_input_move_diagonal(4,2)
  245. when 3; execute_input_move_diagonal(6,2)
  246. when 7; execute_input_move_diagonal(4,8)
  247. when 9; execute_input_move_diagonal(6,8)
  248. end
  249. end

  250. #--------------------------------------------------------------------------
  251. # ● Can Move By Input Dash
  252. #--------------------------------------------------------------------------
  253. def can_move_by_input_dash?
  254. return false if !movable?
  255. return false if self.action != nil
  256. return false if @stop
  257. return false if $game_map.interpreter.running?
  258. return true
  259. end

  260. #--------------------------------------------------------------------------
  261. # ● Execute Input Move Diagonal
  262. #--------------------------------------------------------------------------
  263. def execute_input_move_diagonal(x,y)
  264. move_diagonal(x, y)
  265. return if moving?
  266. move_straight(x)
  267. move_straight(y)
  268. end

  269. end

  270. #===============================================================================
  271. # ■ RPG_FileTest
  272. #===============================================================================
  273. module RPG_FileTest

  274. #--------------------------------------------------------------------------
  275. # ● RPG_FileTest.character_exist?
  276. #--------------------------------------------------------------------------
  277. def RPG_FileTest.character_exist?(filename)
  278. return Cache.character(filename) rescue return false
  279. end

  280. end

  281. #===============================================================================
  282. # ■ Game Follower
  283. #===============================================================================
  284. class Game_Follower < Game_Character

  285. #--------------------------------------------------------------------------
  286. # ● Refresh
  287. #--------------------------------------------------------------------------
  288. alias mog_dash_sprite_follower_refresh refresh
  289. def refresh
  290. mog_dash_sprite_follower_refresh
  291. check_dash_sprite
  292. check_real_name
  293. end

  294. #--------------------------------------------------------------------------
  295. # ● Update
  296. #--------------------------------------------------------------------------
  297. alias mog_dash_sprite_follower_update update
  298. def update
  299. mog_dash_sprite_follower_update
  300. if $game_player.dash
  301. update_dash_sprite_name(false)
  302. else
  303. update_dash_sprite_name(true)
  304. end
  305. end

  306. end

  307. $mog_rgss3_simple_movement_system = true
复制代码
  1. #==============================================================================
  2. # ■ 弹性滚动地图 V 1.00 BY SLICK
  3. #------------------------------------------------------------------------------
  4. #  处理主角的类。事件启动的判定、以及地图的滚动等功能。
  5. # 本类的实例请参考 $game_player。
  6. # 我:。。。这个黄金版已经被改的面目全非了
  7. #==============================================================================

  8. class Game_Player < Game_Character
  9. MOVESPEA = 0.265625#这数值。。。囧
  10. def update_scroll(last_real_x, last_real_y)
  11. ax1 = $game_map.adjust_x(last_real_x)
  12. ay1 = $game_map.adjust_y(last_real_y)
  13. ax2 = $game_map.adjust_x(@real_x)
  14. ay2 = $game_map.adjust_y(@real_y)
  15. movespeb = (2 ** (@move_speed+1))*MOVESPEA
  16. movesped = movespeb / Graphics.width
  17. movespec = movespeb / Graphics.height
  18. tmp=center_x-ax2
  19. $game_map.scroll_left(movesped*tmp) if tmp>0
  20. $game_map.scroll_right(-movesped*tmp) if tmp<0
  21. tmp=center_y-ay2
  22. $game_map.scroll_up(movespec*tmp) if tmp>0
  23. $game_map.scroll_down(-movespec*tmp) if tmp<0
  24. end
  25. end
复制代码
已经找到原因,以上两个插件脚本都会导致单体动画播放时。动画逐渐下移......
除了不使用外,有什么办法能解决呢?或者找到出错的原因也好......

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

本版积分规则

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

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

GMT+8, 2024-11-16 19:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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