Project1
标题:
hys111111的事件打包脚本修改后的问题
[打印本页]
作者:
chd114
时间:
2013-5-30 21:56
标题:
hys111111的事件打包脚本修改后的问题
#==============================================================================
# 本脚本作者hys111111,使用和转载请保留此信息
#==============================================================================
=begin
for maps_id in 1..999
if maps_id<=9
map = load_data("Data/Map00#{maps_id}.rxdata")
else
if map_id<=99
map = load_data("Data/Map0#{maps_id}.rxdata")
else
map = load_data("Data/Map#{maps_id}.rxdata")
end
end
end
=end
map = load_data("Data/Map001.rxdata")
copy = 0
for event_map in 1..10
for event_id in 1..10
for event_x in 1..10
for event_y in 1..10
if event_map<=9
if FileTest.exist?("Into/M00#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
for value in 1..map.events.size + 1
if map.events[value] == nil
map.events[value] = RPG::Event.new(event_x,event_y)
map.events[value] = load_data("Into/M00#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
map.events[value].id = value
File.delete("Into/M00#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
copy += 1
break
end
end
end
else
if
if FileTest.exist?("Into/M0#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
for value in 1..map.events.size + 1
if map.events[value] == nil
map.events[value] = RPG::Event.new(event_x,event_y)
map.events[value] = load_data("Into/M0#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
map.events[value].id = value
File.delete("Into/M0#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
copy += 1
break
end
end
end
else
if FileTest.exist?("Into/M#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
for value in 1..map.events.size + 1
if map.events[value] == nil
map.events[value] = RPG::Event.new(event_x,event_y)
map.events[value] = load_data("Into/E#{event_id}X#{event_x}Y#{event_y}.rxdata")
map.events[value].id = value
File.delete("Into/M#{event_map}E#{event_id}X#{event_x}Y#{event_y}.rxdata")
copy += 1
break
end
end
end
end
end
end
end
end
end
if copy > 0
save_data(map,"Data/Map001.rxdata")
p "你成功导入#{copy}个事件,请重新打开工程。"
exit
end
复制代码
这个是读取事件的部分
#==============================================================================
# 本脚本作者hys111111,使用和转载请保留此信息
#==============================================================================
class Dump_Event
def initialize
if $game_variables[2]<=9
map = load_data("Data/Map00#{$game_variables[2]}.rxdata")
else
if $game_variables[2]<=99
map = load_data("Data/Map0#{$game_variables[2]}.rxdata")
else
map = load_data("Data/Map#{$game_variables[2]}.rxdata")
end
end
x=$game_map.events[$game_variables[1]].x
y=$game_map.events[$game_variables[1]].y
for e in 1..999
p FileTest.exist?("Out/M#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
if $game_variables[2]<=9
unless FileTest.exist?("Out/M00#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
break
end
else
if $game_variables[2]<=99
unless FileTest.exist?("Out/M0#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
break
end
else
unless FileTest.exist?("Out/M#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
break
end
end
end
end
if e == 999
p "储存量过大"
else
if $game_variables[2]<=9
save_data(map.events[$game_variables[1]],"Out/M00#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
map.events.delete($game_variables[1])
save_data(map,"Data/Map#{$game_variables[2]}.rxdata")
else
if $game_variables[2]<=99
save_data(map.events[$game_variables[1]],"Out/M0#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
map.events.delete($game_variables[1])
save_data(map,"Data/Map#{$game_variables[2]}.rxdata")
else
save_data(map.events[$game_variables[1]],"Out/M#{$game_variables[2]}E#{e}X#{x}Y#{y}.rxdata")
map.events.delete($game_variables[1])
save_data(map,"Data/Map#{$game_variables[2]}.rxdata")
end
end
p "打包成功,请在“Out”文件夹里查看。"
exit
end
end
end
复制代码
这个是保存事件的部分,简单说下BUG吧···打包事件的时候我打包3号事件结果把2号打包走了···包的是2号事件,但是文件确是3号事件的数据···
Data.rar
(162.89 KB, 下载次数: 9)
2013-5-30 21:54 上传
点击文件名下载附件
然后呢还原又还原不了超过1号地图的事件···而且X和Y超过10的没法还原,修改名称也不行啊
@hys111111
求解释求指点···我这思路没问题的怎么还是有BUG···
作者:
chd114
时间:
2013-6-1 12:32
@hys111111
@joe5491
不是说等一下吗···我亲一下都没这么久啊···话说回复怎么又被抽了
作者:
chd114
时间:
2013-6-1 13:33
o:RPG::Event
:@pages[o:RPG::Event::Page:@move_typei:
@list[o:RPG::EventCommand:@parameters[ :@indenti :
[url=home.php?mod=space&uid=10416]@codei[/url] :@conditiono: RPG::Event::Page::Condition:@switch2_validF:@self_switch_ch"A:@switch1_idi:@switch1_validF:@variable_valuei :@self_switch_validF:@variable_idi:@variable_validF:@switch2_idi:@direction_fixF:@move_routeo:RPG::MoveRoute; [o:RPG::MoveCommand;[ ;
io;;[ ;
io;;[ ;
i o;;[ ;
i o;;[ ;
io;;[ ;
io;;[ ;
io;;[ ;
io;;[ ;
i :@skippableF:@repeatT:
@triggeri:@step_animeT:@move_frequencyi
:
@graphico:RPG::Event::Page::Graphic:
@opacityi:@character_name"015-Warrior03:
@patterni :
@tile_idi :@directioni:@blend_typei :@character_huei :@always_on_topF:@walk_animeT:@move_speedi:
@throughF:
@name"
EV001:@yi:@xi
:@idi
复制代码
我用记事本打开看到的东西···
作者:
chd114
时间:
2013-6-5 15:02
@joe5491 555你这个负心人···你不是也说过要改进这玩意的吗···
作者:
chd114
时间:
2013-6-5 15:03
@joe5491 怎么没@出来》
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1