Salve a tutti, sto cercando di modificare il seguente script, che mette il gioco in pausa:
###############################################################################
#Pause Script Version 1.0
###############################################################################
module Baelgard
PAUSE_BUTTON = "ALT"
PAUSE_TEXT = "Pausa"
#allow/disallow freezing play time during pause
STOP_TIME = true
#Set a switch name to allow/disallow pause
PAUSE_SW_NAME = "Pause"
PAUSE_BUTTON2 = eval("Input::#{PAUSE_BUTTON}")
def stopping
viewport1 = Viewport.new(0, 0, 640, 480)
viewport1.z = 10000
sprite1 = Sprite.new(viewport1)
sprite1.tone = Tone.new(0, 0, 0, 0)
sprite1.bitmap = Cache.system ("pause")
loop do
Graphics.update
Input.update
if Input.trigger?(PAUSE_BUTTON2)
break
end
end
sprite1.dispose
sprite1 = nil
end
#--------------------------------------------------------------------------
def can_stop?
if PAUSE_SW_NAME.is_a?(Numeric)
return ($game_switches[PAUSE_SW_NAME] rescue true)
else
return ($game_switches[$data_system.switches.index(PAUSE_SW_NAME)] rescue true)
end
end
end
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
include Baelgard
alias baelgard_update update
def update
if Input.trigger?(PAUSE_BUTTON2) and can_stop?
Sound.play_decision
tmp = Graphics.frame_count
stopping
if STOP_TIME
Graphics.frame_count = tmp
end
end
baelgard_update
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
include Baelgard
alias baelgard_update update
def update
if Input.trigger?(PAUSE_BUTTON2) and can_stop?
tmp = Graphics.frame_count
stopping
if STOP_TIME
Graphics.frame_count = tmp
end
end
baelgard_update
end
end
In pratica vorrei che quando si mettesse in pausa, l'audio generale venisse stoppato, o almeno abbassato di volume; quindi ho provato inserendo queste stringhe (in grassetto):
class Scene_Map
include Baelgard
alias baelgard_update update
def update
if Input.trigger?(PAUSE_BUTTON2) and can_stop?
RPG::BGM.fade(180)
RPG::BGS.fade(180)
RPG::ME.fade(180)
tmp = Graphics.frame_count
stopping
if STOP_TIME
Graphics.frame_count = tmp
end
$game_map.autoplay
end
baelgard_update
end
end
In questo modo l'audio viene stoppato, ma quando si riprende il gioco, l'audio riparte dall'inizio, e con una musica in sottofondo è piuttosto brutto....
Se non è possibile stoppare l'audio e farlo riprendere da dove si è stoppato, è possibile almeno abbassarlo di volume durante la pausa del gioco?
Question
tiauz
Salve a tutti, sto cercando di modificare il seguente script, che mette il gioco in pausa:
############################################################################### #Pause Script Version 1.0 ############################################################################### module Baelgard PAUSE_BUTTON = "ALT" PAUSE_TEXT = "Pausa" #allow/disallow freezing play time during pause STOP_TIME = true #Set a switch name to allow/disallow pause PAUSE_SW_NAME = "Pause" PAUSE_BUTTON2 = eval("Input::#{PAUSE_BUTTON}") def stopping viewport1 = Viewport.new(0, 0, 640, 480) viewport1.z = 10000 sprite1 = Sprite.new(viewport1) sprite1.tone = Tone.new(0, 0, 0, 0) sprite1.bitmap = Cache.system ("pause") loop do Graphics.update Input.update if Input.trigger?(PAUSE_BUTTON2) break end end sprite1.dispose sprite1 = nil end #-------------------------------------------------------------------------- def can_stop? if PAUSE_SW_NAME.is_a?(Numeric) return ($game_switches[PAUSE_SW_NAME] rescue true) else return ($game_switches[$data_system.switches.index(PAUSE_SW_NAME)] rescue true) end end end #============================================================================== # Scene_Map #============================================================================== class Scene_Map include Baelgard alias baelgard_update update def update if Input.trigger?(PAUSE_BUTTON2) and can_stop? Sound.play_decision tmp = Graphics.frame_count stopping if STOP_TIME Graphics.frame_count = tmp end end baelgard_update end end #============================================================================== # Scene_Battle #============================================================================== class Scene_Battle include Baelgard alias baelgard_update update def update if Input.trigger?(PAUSE_BUTTON2) and can_stop? tmp = Graphics.frame_count stopping if STOP_TIME Graphics.frame_count = tmp end end baelgard_update end endIn pratica vorrei che quando si mettesse in pausa, l'audio generale venisse stoppato, o almeno abbassato di volume; quindi ho provato inserendo queste stringhe (in grassetto):
class Scene_Map
include Baelgard
alias baelgard_update update
def update
if Input.trigger?(PAUSE_BUTTON2) and can_stop?
RPG::BGM.fade(180)
RPG::BGS.fade(180)
RPG::ME.fade(180)
tmp = Graphics.frame_count
stopping
if STOP_TIME
Graphics.frame_count = tmp
end
$game_map.autoplay
end
baelgard_update
end
end
In questo modo l'audio viene stoppato, ma quando si riprende il gioco, l'audio riparte dall'inizio, e con una musica in sottofondo è piuttosto brutto....
Se non è possibile stoppare l'audio e farlo riprendere da dove si è stoppato, è possibile almeno abbassarlo di volume durante la pausa del gioco?
Edited by tiauzMY PORTFOLIO:
http://adesign.imagolab.itLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now