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

Project1

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

[转载] 发个好东西 测试编辑 VA

[复制链接]

Lv2.观梦者

梦石
0
星屑
575
在线时间
1752 小时
注册时间
2008-11-7
帖子
1431
跳转到指定楼层
1
发表于 2013-7-24 19:44:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x

  在游戏中 依然 可以编辑地图 目前我只测试地图 其他 还没试   编辑好 保存  按F7键  就可以加载到场景
  1. =begin
  2. #===============================================================================
  3. Title: Test Edit
  4. Author: Tsukihime
  5. Date: Mar 9, 2013
  6. --------------------------------------------------------------------------------
  7. ** Change log
  8. Mar 9, 2013
  9.    - Initial release
  10. --------------------------------------------------------------------------------   
  11. ** Terms of Use
  12. * Free to use in commercial/non-commercial projects
  13. * No real support. The script is provided as-is
  14. * Will do bug fixes, but no compatibility patches
  15. * Features may be requested but no guarantees, especially if it is non-trivial
  16. * Credits to Tsukihime in your project
  17. * Preserve this header
  18. --------------------------------------------------------------------------------
  19. ** Description

  20. This script allows you to edit your game while testplaying the project.
  21. You can also reload data by pressing a button.

  22. Currently you can only reload the map.

  23. --------------------------------------------------------------------------------
  24. ** Usage

  25. Press F7 to reload the map.
  26. Any changes that were made in the editor and saved will be applied.
  27. --------------------------------------------------------------------------------
  28. ** Credits

  29. Based on FenixFyreX's test & play for VX
  30. #===============================================================================
  31. =end
  32. $imported = {} if $imported.nil?
  33. $imported["TH_TestEdit"] = true
  34. #===============================================================================
  35. # ** Configuration
  36. #===============================================================================
  37. module TH
  38.   module Test_Edit
  39.    
  40.     Reload_Map_Button = :F7
  41.     Reload_All_Button = :F8
  42.    
  43.     Excluded_Files = []
  44. #===============================================================================
  45. # ** Rest of script
  46. #===============================================================================   

  47.     #---------------------------------------------------------------------------
  48.     # Reload almost everything. Based on FenixFyre's reload code
  49.     #---------------------------------------------------------------------------
  50.     def self.reload_all
  51.       for file in (Dir.entries("Data") - [".", "..", *Excluded_Files])
  52.         next if (file.include?("Map"))
  53.         basename = File.basename(file, ".*").downcase!
  54.         next if (basename == "scripts")
  55.         eval("$data_#{basename} = load_data('Data/#{file}')")
  56.       end
  57.     end
  58.    
  59.     def self.reload_map
  60.       $game_map.editplay_reload_map if SceneManager.scene_is?(Scene_Map)
  61.     end
  62.   end
  63. end

  64. class Game_Map
  65.   def editplay_reload_map
  66.     setup(@map_id)
  67.     $game_player.center($game_player.x, $game_player.y)
  68.     @need_refresh = true
  69.     SceneManager.scene.editplay_reload_map
  70.   end
  71. end

  72. class Scene_Map < Scene_Base
  73.   
  74.   def editplay_reload_map
  75.     @spriteset.refresh_characters
  76.   end
  77. end

  78. module SceneManager
  79.   class << self
  80.     alias :th_editplay_run :run
  81.   end
  82.   
  83.   #-----------------------------------------------------------------------------
  84.   #-----------------------------------------------------------------------------
  85.   def self.run
  86.     attach_console
  87.     th_editplay_run
  88.   end
  89.   
  90.   #-----------------------------------------------------------------------------
  91.   # You always want a console.
  92.   #-----------------------------------------------------------------------------
  93.   def self.attach_console
  94.     # Get game window text
  95.     console_w = Win32API.new('user32','GetForegroundWindow', 'V', 'L').call
  96.     buf_len = Win32API.new('user32','GetWindowTextLength', 'L', 'I').call(console_w)
  97.     str = ' ' * (buf_len + 1)
  98.     Win32API.new('user32', 'GetWindowText', 'LPI', 'I').call(console_w , str, str.length)
  99.    
  100.     # Initiate console
  101.     Win32API.new('kernel32.dll', 'AllocConsole', '', '').call
  102.     Win32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call('RGSS3 Console')
  103.     $stdout.reopen('CONOUT$')
  104.    
  105.     # Sometimes pressing F12 will put the editor in focus first,
  106.     # so we have to remove the program's name
  107.     game_title = str.strip
  108.     game_title.sub! ' - RPG Maker VX Ace', ''
  109.    
  110.     # Set game window to be foreground
  111.     hwnd = Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title)
  112.     Win32API.new('user32.dll', 'SetForegroundWindow', 'P', '').call(hwnd)
  113.   end
  114. end

  115. module Input
  116.   class << self
  117.     alias :th_editplay_update :update
  118.   end
  119.   
  120.   def self.update
  121.     TH::Test_Edit.reload_map if press?(TH::Test_Edit::Reload_Map_Button)
  122.     TH::Test_Edit.reload_all if press?(TH::Test_Edit::Reload_All_Button)
  123.     th_editplay_update   
  124.   end
  125. end

  126. #-------------------------------------------------------------------------------
  127. # Dispose original testplay process, make a new one
  128. #-------------------------------------------------------------------------------
  129. if ($TEST || $DEBUG)
  130.   Thread.new {
  131.     system("Game.exe debug")
  132.   }
  133.   sleep(0.01)
  134.   exit
  135. end
复制代码
RPG魔塔:http://rpg.blue/thread-254429-1-1.html
魔塔2:http://rpg.blue/thread-303601-1-1.html
魔塔3: 制作中...MV

Lv2.观梦者

梦石
0
星屑
378
在线时间
483 小时
注册时间
2011-12-16
帖子
212
2
发表于 2013-7-28 10:07:04 | 只看该作者
{:2_271:}楼主确定有效?反正我是没效.....

点评

会有脚本冲突 我试过了 东西是好的  发表于 2013-7-28 10:38
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
20975
在线时间
9335 小时
注册时间
2012-6-19
帖子
7106

开拓者短篇九导演组冠军

3
发表于 2013-7-29 21:00:45 | 只看该作者
其实……直接运行游戏目录下的Game.exe,然后在编辑器中修改、保存,之后通过F12重开游戏读取存档也可以实现类似的效果…………
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
167
在线时间
434 小时
注册时间
2009-1-1
帖子
643
4
发表于 2014-3-24 10:45:48 | 只看该作者
看起来会挺方便呢,先试试了
最近在研究XAS
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 04:44

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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