Project1

标题: 在國外網站發現的有趣腳本 "Edit & Play" (XP和VX適用) [打印本页]

作者: sai90306    时间: 2012-4-22 19:06
标题: 在國外網站發現的有趣腳本 "Edit & Play" (XP和VX適用)
本帖最后由 sai90306 于 2012-4-22 19:10 编辑

不知道有沒有人發過了
說明上寫說能夠同時編輯和玩自己的遊戲
有人要當小白鼠的嗎?

來源http://save-point.org/Thread-xp-vx-script-edit-play--3674
RUBY 代码复制
  1. #===============================================================================
  2.     # * Edit & Play
  3.     #-------------------------------------------------------------------------------
  4.     #   - Version: 2.1
  5.     #   - Date   : 14 / 08 / 2011
  6.     #   - Author : .:Fênix:.
  7.     #   - MSN    : [email][email protected][/email]
  8.     #-------------------------------------------------------------------------------
  9.     #   - Description:
  10.     #     Let you edit and play your game at the same time
  11.     #-------------------------------------------------------------------------------
  12.     #   - Compability:
  13.     #     RPG Maker XP and RPG Maker VX
  14.     #===============================================================================
  15.  
  16.     module Edit_and_Play
  17.       # Activate the script? (true / false)
  18.       Activate = true
  19.       # Key which updates the game
  20.       Update_Key = Input::ALT
  21.       # Data files that won't be reloaded
  22.       File_Exclude = []
  23.       # Scripts that won't be reloaded
  24.       Scripts_Exclude = ["Edit & Play", "Main"]
  25.     end
  26.  
  27.     $VX ||= defined?(Graphics.wait)
  28.  
  29.     if ((Edit_and_Play::Activate) && !(File.file?("Game.rgss#{$VX ? '2a' : 'ad'}")))
  30.  
  31.       char     = $VX ? "v" : "x"
  32.       old_file = "Data/BT_Actors.r#{char}data"
  33.       new_file = "Data/BT_Actors2.r#{char}data"
  34.  
  35.       if ($TEST || $DEBUG)
  36.         File.rename(old_file, new_file) if ($BTEST)
  37.         Thread.new {system("Game.exe")}
  38.         exit
  39.       else
  40.         $TEST = $DEBUG = true
  41.         if (File.file?(new_file))
  42.           File.rename(new_file, old_file)
  43.           $BTEST = true
  44.         end
  45.       end
  46.  
  47.       unless ($VX)
  48.         class Scene_Battle
  49.  
  50.           alias :edit_and_play_1 :main unless ($@)
  51.  
  52.           def main
  53.             edit_and_play_1
  54.             $scene = Scene_Battle.new if ($BTEST)
  55.           end
  56.  
  57.         end
  58.       end
  59.  
  60.       class << Input
  61.  
  62.         alias :edit_and_play_2 :update unless ($@)
  63.  
  64.         def update
  65.           if (trigger?(Edit_and_Play::Update_Key))
  66.             for file in (Dir.entries("Data") - [".", "..", *Edit_and_Play::File_Exclude])
  67.               next if (file.include?("Map"))
  68.               basename = File.basename(file, ".*").downcase!
  69.               if (basename == "scripts")
  70.                 ($VX ? Cache : RPG::Cache).clear
  71.                 for data in load_data("Data/#{file}")
  72.                   next if (Edit_and_Play::Scripts_Exclude.include?(data[1]))
  73.                   eval(Zlib::Inflate.inflate(data[2]))
  74.                 end
  75.                 $game_map.setup($game_map.map_id) if ($game_map != nil && $game_map.map_id != 0)
  76.                 $scene = $scene.class.new
  77.               else
  78.                 eval("$data_#{basename} = load_data('Data/#{file}')")
  79.               end
  80.             end        
  81.           end
  82.           edit_and_play_2
  83.         end
  84.  
  85.       end
  86.  
  87.     end


作者: 真空包装    时间: 2012-4-22 19:30
我怎么看到是中文的?

#================================================= ==============================
    #*编辑及播放
    #------------------------------------------------- ------------------------------
    # - 版本:2.1
    # - 日期:14/08/2011
     - 作者:FENIX:。
    # -  MSN:[电子邮件] [email protected] [/电子邮件]
    #------------------------------------------------- ------------------------------
    # - 描述:
    #让您编辑和播放在同一时间你的游戏
    #------------------------------------------------- ------------------------------
    # -  Compability:
    #的RPG MAKER XP和RPG MAKER VX的
    #================================================= ==============================

    模块 Edit_and_Play
      #启动脚本?(真/假)
      激活= TRUE
      #键更新游戏
      Update_Key = 输入:: ALT
      #数据文件不会被重载
      File_Exclude = [ ]
      #不会被重新加载脚本
      Scripts_Exclude = [ “编辑和播放”,“主” ]
    结束

    VX | | = 定义?(图形。等待)

     ((Edit_and_Play ::激活) &&! (档案文件(“Game.rgss#{$ VX '2 A吗?”:“广告”}“ )))

      字符= $ VX的“V” :“X”
      old_file = “数据/ BT_Actors.r#{char}上的数据”
      new_file =的“Data/BT_Actors2.r#{字符}数据”

      如果 ( $测试| | $调试)
        文件。重命名( old_file,new_file )  ( $ BTEST )
        主题。新 系统(“Game.exe” )}
        出口
      其他
        $测试 = $ DEBUG = 真
        如果 (文件。文件(new_file ))
          文件。重命名( new_file,old_file )
          美元BTEST = 真
        结束
      结束

      除非 ( $ VX的)
        类 Scene_Battle

          别名 :edit_and_play_1  :主要 除非 ( $ @ )

          DEF主
            edit_and_play_1
            $场景 = Scene_Battle。新  ( $ BTEST )
          结束

        结束
      结束

      类 <<输入

        别名 :edit_and_play_2  :更新 ,除非 ( $ @ )

        DEF更新
          如果 (触发(Edit_and_Play :: Update_Key ))
            文件(目录条目(“资料” ) - [ “。” ,“......” ,Edit_and_Play :: File_Exclude ] )
              未来 如果 (文件。包括?(“地图” ))
              基名= 文件基本名(文件,“*” ) 。downcase!
               (基名== “脚本” )
                ( $ VX的缓存:角色扮演::高速缓存)。明确
                在 load_data 数据(“数据/#{文件}” )
                  未来 如果 (包括Edit_and_Play :: Scripts_Exclude。?(数据[ 1 ] ))
                  EVAL (ZLIB ::充气膨胀(数据[ 2 ] ))
                结束
                美元game_map。设置( $ game_map。map_id )  ( $ = 零 && $ game_map。map_id game_map!!= 0 )
                $场景 = $场景。类。新
              其他
                EVAL (“$ data_中的#{基名} = load_data(数据/#{文件}')” )
              结束
            结束        
          结束
          edit_and_play_2
        结束

      结束

    结束

作者: 布里蓝    时间: 2012-4-22 19:35
同时编辑和玩自己的游戏?这个不用脚本就能做到了吧


‘‘──布里蓝于2012-4-22 21:47补充以下内容

我的浏览器不能复制这种格式的代码……
所以只能等喽~
估计是用软件测试时也能编辑吧
’’
作者: 匿名    时间: 2012-4-22 23:44
這東西的用戶友好度絕對比目前石器內部的各種編輯器低。




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