Project1
标题:
发个好东西 测试编辑 VA
[打印本页]
作者:
z2z4
时间:
2013-7-24 19:44
标题:
发个好东西 测试编辑 VA
在游戏中 依然 可以编辑地图 目前我只测试地图 其他 还没试 编辑好 保存 按F7键 就可以加载到场景
=begin
#===============================================================================
Title: Test Edit
Author: Tsukihime
Date: Mar 9, 2013
--------------------------------------------------------------------------------
** Change log
Mar 9, 2013
- Initial release
--------------------------------------------------------------------------------
** Terms of Use
* Free to use in commercial/non-commercial projects
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Credits to Tsukihime in your project
* Preserve this header
--------------------------------------------------------------------------------
** Description
This script allows you to edit your game while testplaying the project.
You can also reload data by pressing a button.
Currently you can only reload the map.
--------------------------------------------------------------------------------
** Usage
Press F7 to reload the map.
Any changes that were made in the editor and saved will be applied.
--------------------------------------------------------------------------------
** Credits
Based on FenixFyreX's test & play for VX
#===============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_TestEdit"] = true
#===============================================================================
# ** Configuration
#===============================================================================
module TH
module Test_Edit
Reload_Map_Button = :F7
Reload_All_Button = :F8
Excluded_Files = []
#===============================================================================
# ** Rest of script
#===============================================================================
#---------------------------------------------------------------------------
# Reload almost everything. Based on FenixFyre's reload code
#---------------------------------------------------------------------------
def self.reload_all
for file in (Dir.entries("Data") - [".", "..", *Excluded_Files])
next if (file.include?("Map"))
basename = File.basename(file, ".*").downcase!
next if (basename == "scripts")
eval("$data_#{basename} = load_data('Data/#{file}')")
end
end
def self.reload_map
$game_map.editplay_reload_map if SceneManager.scene_is?(Scene_Map)
end
end
end
class Game_Map
def editplay_reload_map
setup(@map_id)
$game_player.center($game_player.x, $game_player.y)
@need_refresh = true
SceneManager.scene.editplay_reload_map
end
end
class Scene_Map < Scene_Base
def editplay_reload_map
@spriteset.refresh_characters
end
end
module SceneManager
class << self
alias :th_editplay_run :run
end
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
def self.run
attach_console
th_editplay_run
end
#-----------------------------------------------------------------------------
# You always want a console.
#-----------------------------------------------------------------------------
def self.attach_console
# Get game window text
console_w = Win32API.new('user32','GetForegroundWindow', 'V', 'L').call
buf_len = Win32API.new('user32','GetWindowTextLength', 'L', 'I').call(console_w)
str = ' ' * (buf_len + 1)
Win32API.new('user32', 'GetWindowText', 'LPI', 'I').call(console_w , str, str.length)
# Initiate console
Win32API.new('kernel32.dll', 'AllocConsole', '', '').call
Win32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call('RGSS3 Console')
$stdout.reopen('CONOUT$')
# Sometimes pressing F12 will put the editor in focus first,
# so we have to remove the program's name
game_title = str.strip
game_title.sub! ' - RPG Maker VX Ace', ''
# Set game window to be foreground
hwnd = Win32API.new('user32.dll', 'FindWindow', 'PP','N').call(0, game_title)
Win32API.new('user32.dll', 'SetForegroundWindow', 'P', '').call(hwnd)
end
end
module Input
class << self
alias :th_editplay_update :update
end
def self.update
TH::Test_Edit.reload_map if press?(TH::Test_Edit::Reload_Map_Button)
TH::Test_Edit.reload_all if press?(TH::Test_Edit::Reload_All_Button)
th_editplay_update
end
end
#-------------------------------------------------------------------------------
# Dispose original testplay process, make a new one
#-------------------------------------------------------------------------------
if ($TEST || $DEBUG)
Thread.new {
system("Game.exe debug")
}
sleep(0.01)
exit
end
复制代码
作者:
7456zll
时间:
2013-7-28 10:07
{:2_271:}楼主确定有效?反正我是没效.....
作者:
喵呜喵5
时间:
2013-7-29 21:00
其实……直接运行游戏目录下的Game.exe,然后在编辑器中修改、保存,之后通过F12重开游戏读取存档也可以实现类似的效果…………
作者:
赛露休斯
时间:
2014-3-24 10:45
看起来会挺方便呢,先试试了
作者:
十二面相
时间:
前天 20:25
喵呜喵5 发表于 2013-7-29 21:00
其实……直接运行游戏目录下的Game.exe,然后在编辑器中修改、保存,之后通过F12重开游戏读取存档也可以实 ...
妙啊
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1