查看: 65|回复: 0

[转载发布] 【加工】行走图转换器(VA/VX -> XP)

[复制链接]
  • TA的每日心情
    开心
    4 天前
  • 签到天数: 33 天

    连续签到: 1 天

    [LV.5]常住居民I

    2022

    主题

    32

    回帖

    7144

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    0
    卡币
    5074
    OK点
    16
    积分
    7144
    发表于 同元一千年八月七日(秋) | 显示全部楼层 |阅读模式
    之前写过一个脚本可以直接在XP上使用VA/VX的单个行走图,这个脚本用起来还凑合,主要的问题就是VX/VA的行走图有很多是8个人放在一张图上的,放到XP里面还得先裁剪。即便是单张4×3的行走图,在编辑器中显示也是怪怪的。最近锅盖要办什么事件剧情设计大赛,需要把VA行走图搞的XP上,于是就写了这个脚本。
    用法十分简单,脚本里面已经附上说明。
    RUBY 代码
    [code]#=========================================================================
    # 行走图转换工具 VA->XP Ver 1.0
    #-------------------------------------------------------------------------
    # @Author : RyanBern
    #-------------------------------------------------------------------------
    # 用法:
    #   将待转换的 VA 行走图放入工程根目录的 vx_chara_s 文件夹下,并新建一个
    #   文件夹 xp_chara_s 用于存放转换好的 XP 行走图。新的行走图文件名会命名
    #   为 原行走图_00~原行走图_07.png,必要时请设置横向和纵向格栅数。
    #   然后将此脚本插入到 Main 组之前,运行游戏工程,在标题画面按下 Z 键即可
    #   进行批量转换。使用完毕后,可以将此脚本删除(附带的MGC_PNG.dll如果用不
    #   到也可以删掉)
    #=========================================================================
    module Char_VA2XP
      # VA 行走图文件夹(输入)
      Dir_In  = "vx_chara_s"

      # XP 行走图文件夹(输出)
      Dir_Out = "xp_chara_s"

      # 横向格栅数(即一张图横向有多少个角色)
      NUMS_X = 4

      # 纵向格栅数(即一张图纵向有多少个角色)
      NUMS_Y = 2

      defself.start_covert
        $scene = Scene_Char_Convert
      end
      class Window_Progress < ::Window_Base
        def initialize
          super(0, 0, 288, 96)
          @curr = @tol = 0
          self.contents = Bitmap.new(width - 32, height - 32)
          self.x = 320 - width / 2
          self.y = 240 - height / 2
          self.opacity = 0
          refresh
        end
        def refresh
          self.contents.clear
          refresh_words
          refresh_progress
        end
        def refresh_words
          self.contents.draw_text(4, 0, width - 36, 32, "Converting...Please wait...")
        end
        def refresh_progress
          self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))
          self.contents.draw_text(96, 32, 48, 32, @curr.to_s, 2)
          self.contents.draw_text(144, 32, 24, 32, "/", 1)
          self.contents.draw_text(168, 32, 48, 32, @tol.to_s)
        end
        def set(curr, tol)
          if@curr != curr || @tol != tol
            @curr, @tol = curr, tol
            refresh_progress
          end
        end
      end
      class Scene_Char_Convert
        def main
          @progress_window = Window_Progress.new
          Graphics.transition
          start_convert
          Graphics.freeze
          @progress_window.dispose
          print"done"
          exit
        end
        def start_convert
          filenames_in = []
          unlessFileTest.exist?(Dir_Out)
            Dir.mkdir(Dir_Out)
          end
          Dir.foreach(Dir_In)do |s|
            filenames_in

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 论坛版权

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2024-5-2 21:58 , Processed in 0.060886 second(s), 44 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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