Quoted from my post in the VXA board:
I was told this would be best achieved with a script but I'm a noob at scripting.
I was told this would be best achieved with a script but I'm a noob at scripting.
$game_message.clear
$game_message.visible = false
class Scene_Map < Scene_Base
alias hrk_scene_change_old scene_change_ok?
def scene_change_ok?
$game_switches[pick_a_switch_id] || hrk_scene_change_old
end
end
class Scene_Map < Scene_Base
alias hrk_scene_change_old scene_change_ok?
def scene_change_ok?
$game_switches[47] || hrk_scene_change_old
end
end
That's strange, it works perfectly in a blank project. I didn't use the timer, but the Game Over scene was successfully called even with the message there. Here is my event.
class Scene_Map < Scene_Base
alias hrk_update_no_timer_old update
def update
hrk_update_no_timer_old
if ($game_switches[47] && ($game_timer.sec == 0))
SceneManager.call(Scene_Gameover)
end
end # Update
end # Scene_Map class
I know this is basically a necro post, but I thought I could share a slight change to the proposed script.
# Credit
# Heirukichi
# Roninator2
module R2_Battle_Timer_End
Switch = 47
end
class Scene_Map < Scene_Base
alias hrk_update_no_timer_old update
def update
hrk_update_no_timer_old
if ($game_switches[R2_Battle_Timer_End::Switch] && ($game_timer.sec == 0))
$game_message.add("Death Comes For You.")
wait_for_message while $game_message.busy?
SceneManager.call(Scene_Gameover)
end
end
def wait_for_message
Graphics.update
Input.update
update_all_windows
end
end
class Scene_Battle < Scene_Base
alias hrk_update_no_timer_old update
def update
hrk_update_no_timer_old
if ($game_switches[R2_Battle_Timer_End::Switch] && ($game_timer.sec == 0))
$game_message.add("Death Comes For You.")
wait_for_message
SceneManager.call(Scene_Gameover)
end
end
end
module BattleManager
class << self; alias :r2_switch_off_victory :process_victory; end
def self.process_victory
$game_switches[R2_Battle_Timer_End::Switch] = false
$game_timer.stop if $game_timer.working?
r2_switch_off_victory
end
end
class Game_Timer
def on_expire
end
end
Original thread: https://forums.rpgmakerweb.com/threads/countdown-timer-that-interrupts-messages.111513/