本帖最后由 chd114 于 2015-8-23 05:05 编辑
这个东西现在已知的有4个坏处
单次倒流时间不能太长、使用频率不能太高,否则都可能卡住
使用这个脚本以后你无法直接按下x键打开菜单
存档以后读档再使用时间回溯就会因为无法读取到之前的时间而出错
class Scene_Map attr_accessor :t, :timer, :spriteset alias lbq_pw_hack_start start def start lbq_pw_hack_start @window_time = Window_Time.new end alias lbq_pw_hack_update update def update lbq_pw_hack_update $game_system.update_timer if $game_system.timer % 1 == 0 p 123#如果你选择长按切菜单则这个123不会输出,否则一直输出 record end unless Input.press?(:X) || $game_switches[23] unless $game_switches[23] if $game_system.t.size / 60.0 >= 60 $game_switches[22] = true $game_switches[23] = true end end update_rewind @window_time.refresh @window_time.update end def record $game_system.t << GameData.new.pack $game_system.t.delete_at(0) if $game_system.t.size > 360 * 10 end def update_rewind if Input.press?(:X) rewind end end def rewind return if $game_system.t.empty? $game_system.t.last.unpack $game_system.t.delete($game_system.t.last) end end
class Scene_Map
attr_accessor :t, :timer, :spriteset
alias lbq_pw_hack_start start
def start
lbq_pw_hack_start
@window_time = Window_Time.new
end
alias lbq_pw_hack_update update
def update
lbq_pw_hack_update
$game_system.update_timer
if $game_system.timer % 1 == 0
p 123#如果你选择长按切菜单则这个123不会输出,否则一直输出
record
end unless Input.press?(:X) || $game_switches[23]
unless $game_switches[23]
if $game_system.t.size / 60.0 >= 60
$game_switches[22] = true
$game_switches[23] = true
end
end
update_rewind
@window_time.refresh
@window_time.update
end
def record
$game_system.t << GameData.new.pack
$game_system.t.delete_at(0) if $game_system.t.size > 360 * 10
end
def update_rewind
if Input.press?(:X)
rewind
end
end
def rewind
return if $game_system.t.empty?
$game_system.t.last.unpack
$game_system.t.delete($game_system.t.last)
end
end
|