脚本帮你写了一下,asperta这个hash里面保存的是自动替换前后的音效名列表,如果你要手动替换也可以,把列表清掉就行了。se.txt保存着哪个地图ID的哪个事件ID有哪个音效。替换后的会保存到Data1文件夹里。建议替换前先备份。
#自动替换地图指定事件SE文件名 by asperta asperta = { "001-System01"=>"002-System02", "003-System03"=>"004-System04", "替换前"=>"替换后"} Dir.mkdir("Data1") unless File.directory?("Data1") ary = Dir.entries("Data/") str = "" for a in ary if a =~ /Map\d\d\d/ @map = load_data("Data/"+a) @map.events.each {|key, value| for i in 0...value.pages.size for j in 0...value.pages[i].list.size if value.pages[i].list[j].code == 250 str += "地图:" + a + " 事件:" + key.to_s str += " SE名字:" + value.pages[i].list[j].parameters[0].name + "\n" if !asperta.empty? asperta.each {|k, v| if k == value.pages[i].list[j].parameters[0].name value.pages[i].list[j].parameters[0].name = v end } end end end end } save_data(@map,"Data1/"+a) end end File.open("se.txt","w").write(str) exit
#自动替换地图指定事件SE文件名 by asperta
asperta = {
"001-System01"=>"002-System02",
"003-System03"=>"004-System04",
"替换前"=>"替换后"}
Dir.mkdir("Data1") unless File.directory?("Data1")
ary = Dir.entries("Data/")
str = ""
for a in ary
if a =~ /Map\d\d\d/
@map = load_data("Data/"+a)
@map.events.each {|key, value|
for i in 0...value.pages.size
for j in 0...value.pages[i].list.size
if value.pages[i].list[j].code == 250
str += "地图:" + a + " 事件:" + key.to_s
str += " SE名字:" + value.pages[i].list[j].parameters[0].name + "\n"
if !asperta.empty?
asperta.each {|k, v|
if k == value.pages[i].list[j].parameters[0].name
value.pages[i].list[j].parameters[0].name = v
end
}
end
end
end
end
}
save_data(@map,"Data1/"+a)
end
end
File.open("se.txt","w").write(str)
exit
|