Project1

标题: 新人提问,开场动画怎么跳过(有解决方案了,不会插的..... [打印本页]

作者: 381226395    时间: 2015-3-16 22:21
标题: 新人提问,开场动画怎么跳过(有解决方案了,不会插的.....
本帖最后由 381226395 于 2015-3-17 09:55 编辑

原本是提问题!不过自己解决了 !还谢谢谢谢龙月的脚本!不过我没按他说的用。
下面是脚本之一
  1. class String

  2. CP_ACP = 0
  3. CP_UTF8 = 65001

  4. def u2s
  5. m2w = Win32API.new("kernel32", "MultiByteToWideChar", "ilpipi", "i")
  6. w2m = Win32API.new("kernel32", "WideCharToMultiByte", "ilpipipp", "i")

  7. len = m2w.call(CP_UTF8, 0, self, -1, nil, 0)
  8. buf = "\0" * (len*2)
  9. m2w.call(CP_UTF8, 0, self, -1, buf, buf.size/2)

  10. len = w2m.call(CP_ACP, 0, buf, -1, nil, 0, nil, nil)
  11. ret = "\0" * len
  12. w2m.call(CP_ACP, 0, buf, -1, ret, ret.size, nil, nil)

  13. return ret
  14. end

  15. def s2u
  16. m2w = Win32API.new("kernel32", "MultiByteToWideChar", "ilpipi", "i")
  17. w2m = Win32API.new("kernel32", "WideCharToMultiByte", "ilpipipp", "i")

  18. len = m2w.call(CP_ACP, 0, self, -1, nil, 0);
  19. buf = "\0" * (len*2)
  20. m2w.call(CP_ACP, 0, self, -1, buf, buf.size/2);

  21. len = w2m.call(CP_UTF8, 0, buf, -1, nil, 0, nil, nil);
  22. ret = "\0" * len
  23. w2m.call(CP_UTF8, 0, buf, -1, ret, ret.size, nil, nil);

  24. return ret
  25. end

  26. def s2u!
  27. self[0, length] = s2u
  28. end

  29. def u2s!
  30. self[0, length] = u2s
  31. end

  32. end

  33. class Bitmap

  34. RtlMoveMemory_pi = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
  35. RtlMoveMemory_ip = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')

  36. def address
  37. buffer, ad = "xxxx", object_id * 2 + 16
  38. RtlMoveMemory_pi.call(buffer, ad, 4); ad = buffer.unpack("L")[0] + 8
  39. RtlMoveMemory_pi.call(buffer, ad, 4); ad = buffer.unpack("L")[0] + 16
  40. RtlMoveMemory_pi.call(buffer, ad, 4); return buffer.unpack("L")[0]
  41. end

  42. end

  43. class RMFlash

  44. API_NEW = Win32API.new("RMFlash", "_new", "piil", "l")
  45. API_UPDATE = Win32API.new("RMFlash", "_update", "l", "v")
  46. API_FREE = Win32API.new("RMFlash", "_free", "l", "v")
  47. API_PLAYING = Win32API.new("RMFlash", "_is_playing", "l", "i")
  48. API_PAUSE = Win32API.new("RMFlash", "_pause", "l", "v")
  49. API_RESUME = Win32API.new("RMFlash", "_resume", "l", "v")
  50. API_BACK = Win32API.new("RMFlash", "_back", "l", "v")
  51. API_REWIND = Win32API.new("RMFlash", "_rewind", "l", "v")
  52. API_FORWARD = Win32API.new("RMFlash", "_forward", "l", "v")
  53. API_CURFRAME = Win32API.new("RMFlash", "_cur_frame", "l", "i")
  54. API_TOTALFRAME = Win32API.new("RMFlash", "_total_frames", "l", "i")
  55. API_GOTOFRAME = Win32API.new("RMFlash", "_goto_frame", "li", "v")
  56. API_GETLOOP = Win32API.new("RMFlash", "_get_loop", "l", "i")
  57. API_SETLOOP = Win32API.new("RMFlash", "_set_loop", "li", "v")
  58. API_CLEARALL = Win32API.new("RMFlash", "_clear_all", "v", "v")
  59. API_VALID = Win32API.new("RMFlash", "_valid", "l", "i")
  60. API_SENDMSG = Win32API.new("RMFlash", "_send_message", "liii", "l")

  61. CUR_PATH = Dir.pwd

  62. def self.get_version

  63. end

  64. def self.clear_all
  65. API_CLEARALL.call
  66. end

  67. def self.load(name, width, height, v = nil)
  68. new("#{CUR_PATH}/#{name}".u2s, width, height, v)
  69. end

  70. attr_reader :valid

  71. def initialize(flash_name, flash_width, flash_height, viewport = nil)
  72. @sprite = Sprite.new(viewport)
  73. @sprite.bitmap = Bitmap.new(flash_width, flash_height)
  74. @value = API_NEW.call(flash_name, flash_width, flash_height, @sprite.bitmap.address)
  75. @loop = API_GETLOOP.call(@value) > 0
  76. @valid = API_VALID.call(@value) > 0
  77. end

  78. def viewport
  79. @sprite.viewport
  80. end

  81. def update
  82. API_UPDATE.call(@value)
  83. end

  84. def dispose
  85. API_FREE.call(@sprite.bitmap.address)
  86. end

  87. def playing?
  88. API_PLAYING.call(@value) > 0
  89. end

  90. def pause
  91. API_PAUSE.call(@value)
  92. end

  93. def resume
  94. API_RESUME.call(@value)
  95. end

  96. def back
  97. API_BACK.call(@value)
  98. end

  99. def rewind
  100. API_REWIND.call(@value)
  101. end

  102. def forward
  103. API_FORWARD.call(@value)
  104. end

  105. def current_frame
  106. API_CURFRAME.call(@value)
  107. end

  108. def total_frames
  109. API_TOTALFRAME.call(@value)
  110. end

  111. def goto_frame(goal_frame)
  112. API_GOTOFRAME.call(@value, goal_frame)
  113. end

  114. def x
  115. @sprite.x
  116. end

  117. def x=(v)
  118. @sprite.x = v
  119. end

  120. def y
  121. @sprite.y
  122. end

  123. def y=(v)
  124. @sprite.y = v
  125. end

  126. def z
  127. @sprite.z
  128. end

  129. def z=(v)
  130. @sprite.z = v
  131. end

  132. def width
  133. @sprite.bitmap.width
  134. end

  135. def height
  136. @sprite.bitmap.height
  137. end

  138. def loop?
  139. @loop
  140. end

  141. def loop=(v)
  142. if @loop != v
  143. @loop = v
  144. API_SETLOOP.call(@value, v)
  145. end
  146. end

  147. def msg_to_flash(msg, wParam, lParam)
  148. return API_SENDMSG.call(@value, msg, wParam, lParam)
  149. end

  150. # 例
  151. WM_MOUSEMOVE = 0x0200

  152. def make_long(a, b)
  153. return (a & 0xffff ) | (b & 0xffff) << 16
  154. end

  155. def on_mouse_move(x, y)
  156. return msg_to_flash(WM_MOUSEMOVE, 0, make_long(x, y))
  157. end

  158. end

  159. module Kernel

  160. alias origin_exit exit unless method_defined? :exit

  161. def exit(*args)
  162. RMFlash.clear_all
  163. origin_exit(*args)
  164. end

  165. end

  166. #fls = RMFlash.load("2.swf", 640, 480)

  167. #while true
  168. # Graphics.update
  169. # Input.update
  170. # fls.update
  171. # break if Input.trigger?(13)
  172. #end
  173. #fls.dispose

  174. #exit

  175. =begin
  176. class RMFlash
  177. API_NEW = Win32API.new("RMFlash", "_new", "piil", "l")
  178. API_UPDATE = Win32API.new("RMFlash", "_update", "l", "v")
  179. API_FREE = Win32API.new("RMFlash", "_free", "l", "v")
  180. #def self.new(*args)
  181. # obj = super(*args)
  182. # obj.send :initialize, *args
  183. # obj
  184. #end

  185. def initialize(flashname, fw, fh)

  186. end

  187. end

  188. RMFlash.new
  189. exit
  190. =end
复制代码
第二个代码
  1. fls = RMFlash.load("goldom.swf",640,480)
  2. fls.x = 0
  3. fls.y = 0
  4. fls.loop = 0
  5. while true
  6. Graphics.update
  7. Input.update
  8. fls.update
  9. break if !fls.playing?
  10. break if Input.trigger?(Input::B)
  11. end
  12. fls.dispose
复制代码
因为我做的是看完动画再进游戏,
所以2个我都插在main之前了。
好了,把SWF文件放在游戏文件夹里
还有这个播放器(上传不了呢)
要的话我传网盘好了!

2楼上传好了

原来我提问是无法跳过开场动画!用这个脚本,ESC就可以了!!



   
作者: 381226395    时间: 2015-3-16 22:23
本帖最后由 381226395 于 2015-3-17 09:44 编辑

播放器也放在游戏文件夹里

1823593gssu4zcagrsts5u.rar

963.25 KB, 下载次数: 36


作者: 381226395    时间: 2015-3-16 22:37
居然解决好了!弱弱问一声,怎么删帖子




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1