查看: 4162|回复: 10

[已经解决] 请问VX的动画可以转换成XP的吗?

[复制链接]
梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
发表于 2020-6-22 16:04:20 | 显示全部楼层 |阅读模式

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

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

×
就是把vx的动画导入XP去,我试过自己跟着VX设置,但是很多很混乱不知道怎么弄,而且有的虽然可以弄,但是没办法弄得很像,为止也不对。请问有没有快捷的方法?还是说就必须自己一点一点去弄?

博客:我的博客
梦石
0
星屑
4638
在线时间
488 小时
注册时间
2017-7-7
回帖
134

R考场第七期纪念奖

发表于 2020-6-22 18:52:35 | 显示全部楼层
应该是只能自己一点一点弄
回复

使用道具 举报

梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
 楼主| 发表于 2020-6-22 20:13:16 | 显示全部楼层
Six_Fish 发表于 2020-6-22 18:52
应该是只能自己一点一点弄

唉,一点一点弄吧。弄好发上来

博客:我的博客
回复

使用道具 举报

梦石
0
星屑
2323
在线时间
207 小时
注册时间
2019-3-30
回帖
144
发表于 2020-6-22 23:25:57 | 显示全部楼层
可以的,我就是一点一点的弄的
回复

使用道具 举报

双子人

梦石
0
星屑
3205
在线时间
3619 小时
注册时间
2009-4-4
回帖
3901

开拓者

发表于 2020-6-23 00:36:46 | 显示全部楼层
下面这个文件和VX的声音、图形素材一起使用。
(如果你做了其他动画,记得备份好,以免覆盖)

Animations.rxdata

345.62 KB, 下载次数: 42

点评

晚点我把我自己弄得也发给你,我把一切缺少的属性攻击动画补齐  发表于 2020-6-23 03:37
回复

使用道具 举报

梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
 楼主| 发表于 2020-6-23 03:29:45 | 显示全部楼层
hys111111 发表于 2020-6-23 00:36
下面这个文件和VX的声音、图形素材一起使用。
(如果你做了其他动画,记得备份好,以免覆盖) ...

你好,请问能把图片一起发给我吗?还有好多个好像没有的图片,所以都是空白的

博客:我的博客
回复

使用道具 举报

梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
 楼主| 发表于 2020-6-23 15:31:39 | 显示全部楼层
hys111111 发表于 2020-6-23 00:36
下面这个文件和VX的声音、图形素材一起使用。
(如果你做了其他动画,记得备份好,以免覆盖) ...

我现在了另一个,终于有那些图片了,只是请问两个图片的,是如何拼接在一起呢?

点评

XP支持的动画大小刚好是VX的两倍(960x7680)vs(960x3840)  发表于 2020-6-23 22:55

博客:我的博客
回复

使用道具 举报

梦石
0
星屑
8003
在线时间
1184 小时
注册时间
2007-7-29
回帖
2014
发表于 2020-6-24 11:25:08 | 显示全部楼层
本帖最后由 enghao_lim 于 2020-6-24 11:26 编辑

以前备份的。
[fold=VX运行]
  1. =begin
  2. VX的动画数据库还是很华丽的,一流华丽,这里提供一个转给XP用户使用的方法。这个算法简单说就是,由于VX使用两张图来制作动画素材,而XP只能用一张,所以我在运算的时候直接把两张图合成为一张图了。此外编号也重调过。如果本来VX两张图的色相有较大诧异可能会转换结果不完美,不过好在默认数据库没有这种情况,就暂时不考虑了。

  3. 注,XP转VX的在这里:http://bbs.66rpg.com/viewthread.php?tid=72045

  4. 我想其他数据库应该没有互转的必要了。应该说,其他的数据库表VX都远胜XP,只要eval(.memo)就可以了。所以我也不转了,有需要时候再说了。

  5. 使用方法:

  6. 1、在VX完整版中执行脚本段落1,这个过程很慢,大约10多分钟,并且这个过程中必须让窗口焦点保持在运行窗口上,建议吃饭前执行(生成图片速度很慢)。

  7. 2、在XP新建一个工程,把刚才生成的vx_ani.6R考到game.exe所在位置,把所有素材图考到Graphics/Animations,再去VX的RTP安装目录把所有声效考过来。

  8. 3、在XP工程中执行脚本段落2,瞬间完成。关闭XP工程,重新打开,则所有VX动画可以使用了。
  9. =end

  10. # 将bitmap对象输出成bmp文件 By MOMOMO
  11. # 翻译:bbschat 来自:www.66rpg.com
  12. # 将Bitmap对象
  13. # 转换成位图文件(24bit)输出。
  14. #
  15. # Bmp_File.make_bmp_file(bitmap, name[, path])
  16. # bitmap:Bitmap对象
  17. # name:保存文件名
  18. # path:保存路径
  19. #
  20. # 或者,对Bitmap对象直接使用
  21. # bitmap_obj.make_bmp_file(name[, path])
  22. # 也可以达成同样的机能。





  23. module Bmp_File
  24. module_function
  25. # 生成BMP文件
  26. def make_bmp_file(bitmap, name, path="")
  27.   file_header = make_bmp_file_header(bitmap)
  28.   info_header = make_bmp_info_header(bitmap)
  29.   bitmap_data = make_bitmap_data(bitmap)
  30.   make_dir(path) if path != ""
  31.   file = File.open(path + name + ".bmp", "wb")
  32.   file.write(file_header)
  33.   file.write(info_header)
  34.   file.write(bitmap_data)
  35.   file.close
  36. end
  37. # 生成保存路径
  38. def make_dir(path)
  39.   dir = path.split("/")
  40.   for i in 0...dir.size
  41.     unless dir == "."
  42.       add_dir = dir[0..i].join("/")
  43.       begin
  44.         Dir.mkdir(add_dir)
  45.       rescue
  46.       end
  47.     end
  48.   end
  49. end
  50. # 从Bitmap对象中生成文件头
  51. def make_bmp_file_header(bitmap)
  52.   bf_type = ["BM"].pack("a2")
  53.   bf_size = [get_bf_size(bitmap)].pack("L")
  54.   bf_Reserved1 = [0].pack("S")
  55.   bf_Reserved2 = [0].pack("S")
  56.   bf_OffBits = [54].pack("L")
  57.   
  58.   file_header = bf_type + bf_size + bf_Reserved1 + bf_Reserved2 + bf_OffBits
  59.   return file_header
  60. end
  61. # 从Bitmap对象中生成情报头
  62. def make_bmp_info_header(bitmap)
  63.   bi_size = [40].pack("L")
  64.   bi_width = [get_bi_width(bitmap)].pack("L")
  65.   bi_height = [get_bi_height(bitmap)].pack("L")
  66.   bi_planes = [1].pack("S")
  67.   bi_bitcount = [24].pack("S")
  68.   bi_copmression = [0].pack("L")
  69.   bi_sizeimage = [0].pack("L")
  70.   bi_x_pixpermeter = [0].pack("L")
  71.   bi_y_pixpermeter = [0].pack("L")
  72.   bi_clrused = [0].pack("L")
  73.   bi_cirimportant = [0].pack("L")
  74.   
  75.   info_header = bi_size + bi_width + bi_height + bi_planes + bi_bitcount +
  76.                 bi_copmression + bi_sizeimage + bi_x_pixpermeter +
  77.                 bi_y_pixpermeter + bi_clrused + bi_cirimportant
  78.   
  79.   return info_header
  80. end
  81. # 从Bitmap对象中生成图像数据
  82. def make_bitmap_data(bitmap)
  83.   w = bitmap.width
  84.   h = bitmap.height
  85.   w = (w / 4 + 1) * 4 if w % 4 != 0
  86.   data = []
  87.   for y in 0...h
  88.     for x in 0...w
  89.       color = bitmap.get_pixel(x, (h - 1) - y)
  90.       data.push(color.blue)
  91.       data.push(color.green)
  92.       data.push(color.red)
  93.     end
  94.   end
  95.   return data.pack("C*")
  96. end
  97. def get_bf_size(bitmap)
  98.   w = bitmap.width
  99.   w = (w / 4 + 1) * 4 if w % 4 != 0
  100.   h = bitmap.height
  101.   return w * h * 3
  102. end
  103. def get_bi_width(bitmap)
  104.   return bitmap.width
  105. end
  106. def get_bi_height(bitmap)
  107.   return bitmap.height
  108. end
  109. end
  110. class Bitmap
  111. def make_bmp_file(name, path="")
  112.   Bmp_File.make_bmp_file(self, name, path)
  113. end
  114. end
  115. #==============================================================================
  116. #               本脚本出自www.66rpg.com,转载请注明。
  117. #==============================================================================
  118. =begin
  119. ==============================================================================
  120.                         Bitmap to PNG By 轮回者
  121. ==============================================================================


  122. 对Bitmap对象直接使用


  123. bitmap_obj.make_png(name[, path])


  124. name:保存文件名
  125. path:保存路径


  126. 感谢66、夏娜、金圭子的提醒和帮助!
  127.    
  128. ==============================================================================
  129. =end


  130. module Zlib
  131.   class Png_File < GzipWriter
  132.     #--------------------------------------------------------------------------
  133.     # ● 主处理
  134.     #--------------------------------------------------------------------------
  135.     def make_png(bitmap_Fx,mode)
  136.       @mode = mode
  137.       @bitmap_Fx = bitmap_Fx
  138.       self.write(make_header)
  139.       self.write(make_ihdr)
  140.       self.write(make_idat)
  141.       self.write(make_iend)
  142.     end
  143.     #--------------------------------------------------------------------------
  144.     # ● PNG文件头数据块
  145.     #--------------------------------------------------------------------------
  146.     def make_header
  147.       return [0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a].pack("C*")
  148.     end
  149.     #--------------------------------------------------------------------------
  150.     # ● PNG文件情报头数据块(IHDR)
  151.     #--------------------------------------------------------------------------
  152.     def make_ihdr
  153.       ih_size = [13].pack("N")
  154.       ih_sign = "IHDR"
  155.       ih_width = [@bitmap_Fx.width].pack("N")
  156.       ih_height = [@bitmap_Fx.height].pack("N")
  157.       ih_bit_depth = [8].pack("C")
  158.       ih_color_type = [6].pack("C")
  159.       ih_compression_method = [0].pack("C")
  160.       ih_filter_method = [0].pack("C")
  161.       ih_interlace_method = [0].pack("C")
  162.       string = ih_sign + ih_width + ih_height + ih_bit_depth + ih_color_type +
  163.                ih_compression_method + ih_filter_method + ih_interlace_method
  164.       ih_crc = [Zlib.crc32(string)].pack("N")
  165.       return ih_size + string + ih_crc
  166.     end
  167.     #--------------------------------------------------------------------------
  168.     # ● 生成图像数据(IDAT)
  169.     #--------------------------------------------------------------------------
  170.     def make_idat
  171.       header = "\x49\x44\x41\x54"
  172.       case @mode # 请54~
  173.       when 1
  174.         data = make_bitmap_data#1
  175.       else
  176.         data = make_bitmap_data
  177.       end
  178.       data = Zlib::Deflate.deflate(data, 8)
  179.       crc = [Zlib.crc32(header + data)].pack("N")
  180.       size = [data.length].pack("N")
  181.       return size + header + data + crc
  182.     end
  183.     #--------------------------------------------------------------------------
  184.     # ● 从Bitmap对象中生成图像数据 mode 1(请54~)
  185.     #--------------------------------------------------------------------------
  186.     def make_bitmap_data1
  187.       w = @bitmap_Fx.width
  188.       h = @bitmap_Fx.height
  189.       data = []
  190.       for y in 0...h
  191.         data.push(0)
  192.         for x in 0...w
  193.           color = @bitmap_Fx.get_pixel(x, y)
  194.           red = color.red
  195.           green = color.green
  196.           blue = color.blue
  197.           alpha = color.alpha
  198.           data.push(red)
  199.           data.push(green)
  200.           data.push(blue)
  201.           data.push(alpha)
  202.         end
  203.       end
  204.       return data.pack("C*")
  205.     end
  206.     #--------------------------------------------------------------------------
  207.     # ● 从Bitmap对象中生成图像数据 mode 0
  208.     #--------------------------------------------------------------------------
  209.     def make_bitmap_data
  210.       gz = Zlib::GzipWriter.open('hoge.gz')
  211.       t_Fx = 0
  212.       w = @bitmap_Fx.width
  213.       h = @bitmap_Fx.height
  214.       data = []
  215.       for y in 0...h
  216.         data.push(0)
  217.         for x in 0...w
  218.           t_Fx += 1
  219.           if t_Fx % 10000 == 0
  220.             Graphics.update
  221.           end
  222.           if t_Fx % 100000 == 0
  223.             s = data.pack("C*")
  224.             gz.write(s)
  225.             data.clear
  226.             #GC.start
  227.           end
  228.           color = @bitmap_Fx.get_pixel(x, y)
  229.           red = color.red
  230.           green = color.green
  231.           blue = color.blue
  232.           alpha = color.alpha
  233.           data.push(red)
  234.           data.push(green)
  235.           data.push(blue)
  236.           data.push(alpha)
  237.         end
  238.       end
  239.       s = data.pack("C*")
  240.       gz.write(s)
  241.       gz.close   
  242.       data.clear
  243.       gz = Zlib::GzipReader.open('hoge.gz')
  244.       data = gz.read
  245.       gz.close
  246.       File.delete('hoge.gz')
  247.       return data
  248.     end
  249.     #--------------------------------------------------------------------------
  250.     # ● PNG文件尾数据块(IEND)
  251.     #--------------------------------------------------------------------------
  252.     def make_iend
  253.       ie_size = [0].pack("N")
  254.       ie_sign = "IEND"
  255.       ie_crc = [Zlib.crc32(ie_sign)].pack("N")
  256.       return ie_size + ie_sign + ie_crc
  257.     end
  258.   end
  259. end
  260. #==============================================================================
  261. # ■ Bitmap
  262. #------------------------------------------------------------------------------
  263. #  关联到Bitmap。
  264. #==============================================================================
  265. class Bitmap
  266.   #--------------------------------------------------------------------------
  267.   # ● 关联
  268.   #--------------------------------------------------------------------------
  269.   def make_png(name="like", path="",mode=0)
  270.     make_dir(path) if path != ""
  271.     Zlib::Png_File.open("temp.gz") {|gz|
  272.       gz.make_png(self,mode)
  273.     }
  274.     Zlib::GzipReader.open("temp.gz") {|gz|
  275.       $read = gz.read
  276.     }
  277.     f = File.open(path + name + ".png","wb")
  278.     f.write($read)
  279.     f.close
  280.     File.delete('temp.gz')
  281.     end
  282.   #--------------------------------------------------------------------------
  283.   # ● 生成保存路径
  284.   #--------------------------------------------------------------------------
  285.   def make_dir(path)
  286.     dir = path.split("/")
  287.     for i in 0...dir.size
  288.       unless dir == "."
  289.         add_dir = dir[0..i].join("/")
  290.         begin
  291.           Dir.mkdir(add_dir)
  292.         rescue
  293.         end
  294.       end
  295.     end
  296.   end
  297. end
  298. #==============================================================================
  299. #               本脚本出自www.66rpg.com,转载请注明。
  300. #==============================================================================
  301. module RPG
  302.   class Animation2
  303.     def initialize
  304.       @id = 0
  305.       @name = ""
  306.       @animation1_name = ""
  307.       @animation1_hue = 0
  308.       @animation2_name = ""
  309.       @animation2_hue = 0
  310.       @position = 1
  311.       @frame_max = 1
  312.       @frames = [RPG::Animation::Frame.new]
  313.       @timings = []
  314.     end
  315.     attr_accessor :id
  316.     attr_accessor :name
  317.     attr_accessor :animation_name
  318.     attr_accessor :animation_hue
  319.     attr_accessor :position
  320.     attr_accessor :frame_max
  321.     attr_accessor :frames
  322.     attr_accessor :timings                 
  323.   end
  324. end


  325. module RPG
  326.   class Animation2
  327.     class Timing
  328.       def initialize
  329.         @frame = 0
  330.         @se = RPG::SE.new("", 80)
  331.         @se_name = ""
  332.         @se_volume = 80
  333.         @se_pitch = 100
  334.         @flash_scope = 0
  335.         @flash_color = Color.new(255,255,255,255)
  336.         @flash_duration = 5
  337.       end
  338.       attr_accessor :frame
  339.       attr_accessor :se
  340.       attr_accessor :se_name
  341.       attr_accessor :se_volume
  342.       attr_accessor :se_pitch
  343.       attr_accessor :flash_scope
  344.       attr_accessor :flash_color
  345.       attr_accessor :flash_duration
  346.     end
  347.   end
  348. end


  349. $data_animations    = load_data("Data/Animations.rvdata")
  350. $vx_ani = []


  351. $sprite = Sprite.new
  352. $sprite.bitmap = Bitmap.new(500, 400)
  353. number = 1
  354. for ani in $data_animations
  355.   number += 1
  356.   next if ani==nil
  357.   $sprite.bitmap.clear
  358.   $sprite.bitmap.draw_text(0, 0, 500, 400, number.to_s + " / " + $data_animations.size.to_s, 1)
  359.   tani = RPG::Animation2.new
  360.   tani.id = ani.id
  361.   tani.name = ani.name
  362.   tani.animation_name = ani.animation1_name+"."+ani.animation2_name
  363.   tani.animation_hue = ani.animation1_hue
  364.   width = 960
  365.   bmp1 = Cache.animation(ani.animation1_name, ani.animation1_hue)
  366.   bmp2 = Cache.animation(ani.animation2_name, ani.animation2_hue)
  367.   height = bmp1.height + bmp2.height
  368.   bmp = Bitmap.new(width, height)
  369.   bmp.blt(0, 0, bmp1, bmp1.rect)
  370.   bmp.blt(0, bmp1.height, bmp2, bmp2.rect)
  371.   bmp.make_png(ani.animation1_name+"."+ani.animation2_name)
  372.   tani.position = ani.position
  373.   tani.frame_max = ani.frame_max
  374.   tani.frames = ani.frames
  375.   for i in 0..15
  376.     for fram in tani.frames
  377.       fram.cell_data[i, 0] -= (100 - bmp1.height * 5/ 192) if fram.cell_data[i, 0] != nil and fram.cell_data[i, 0] > 100
  378.     end
  379.   end
  380.   tani.timings = []
  381.   for timing in ani.timings
  382.     tm = RPG::Animation2::Timing.new
  383.     tm.frame = timing.frame
  384.     tm.se_name = timing.se.name
  385.     tm.se_volume = timing.se.volume
  386.     tm.se_pitch = timing.se.pitch
  387.     tm.flash_scope = timing.flash_scope
  388.     tm.flash_color = timing.flash_color
  389.     tm.flash_duration = timing.flash_duration
  390.     tani.timings.push(tm)
  391.   end
  392.   $vx_ani.push(tani)
  393. end


  394. save_data($vx_ani, "vx_ani.6R")
  395. p "done"
复制代码
[/fold][fold=XP运行]
  1. module RPG
  2.   class Animation2
  3.     def initialize
  4.       @id = 0
  5.       @name = ""
  6.       @animation1_name = ""
  7.       @animation1_hue = 0
  8.       @animation2_name = ""
  9.       @animation2_hue = 0
  10.       @position = 1
  11.       @frame_max = 1
  12.       @frames = [RPG::Animation::Frame.new]
  13.       @timings = []
  14.     end
  15.     attr_accessor :id
  16.     attr_accessor :name
  17.     attr_accessor :animation_name
  18.     attr_accessor :animation_hue
  19.     attr_accessor :position
  20.     attr_accessor :frame_max
  21.     attr_accessor :frames
  22.     attr_accessor :timings                 
  23.   end
  24. end





  25. module RPG
  26.   class SE
  27.     def initialize(i1, i2)
  28.       @i1 = i1
  29.       @i2 = i2
  30.     end
  31.   end
  32. end





  33. module RPG
  34.   class Animation2
  35.     class Timing
  36.       def initialize
  37.         @frame = 0
  38.         @se = RPG::SE.new("", 80)
  39.         @se_name = ""
  40.         @se_volume = 80
  41.         @se_pitch = 100
  42.         @flash_scope = 0
  43.         @flash_color = Color.new(255,255,255,255)
  44.         @flash_duration = 5
  45.       end
  46.       attr_accessor :frame
  47.       attr_accessor :se
  48.       attr_accessor :se_name
  49.       attr_accessor :se_volume
  50.       attr_accessor :se_pitch
  51.       attr_accessor :flash_scope
  52.       attr_accessor :flash_color
  53.       attr_accessor :flash_duration
  54.     end
  55.   end
  56. end


  57. $data_animations    = load_data("Data/Animations.rxdata")
  58. $ani    = load_data("vx_ani.6R")


  59. for ani in $ani
  60.   tani = RPG::Animation.new
  61.   tani.id = ani.id
  62.   tani.name = ani.name
  63.   tani.animation_name = ani.animation_name
  64.   tani.animation_hue = ani.animation_hue
  65.   tani.position = ani.position
  66.   tani.frame_max = ani.frame_max
  67.   tani.frames = ani.frames
  68.   tani.timings = []
  69.   for timing in ani.timings
  70.     tm = RPG::Animation::Timing.new
  71.     tm.frame = timing.frame
  72.     tm.se = RPG::AudioFile.new(timing.se_name, timing.se_volume, timing.se_pitch)
  73.     tm.flash_scope = timing.flash_scope
  74.     tm.flash_color = timing.flash_color
  75.     tm.flash_duration = timing.flash_duration
  76.     tani.timings.push(tm)
  77.   end
  78.   $data_animations.push(tani)
  79. end


  80. save_data($data_animations, "Data/Animations.rxdata")
  81. p "done"
复制代码
[/fold]

评分

参与人数 2星屑 +50 赞 +1 收起 理由
RyanBern + 50 认可答案
爆焰 + 1 认可答案

查看全部评分

回复 1 0

使用道具 举报

梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
 楼主| 发表于 2020-6-24 21:18:06 | 显示全部楼层

谢谢,这个是好东西

博客:我的博客
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部