Jump to content
Rpg²S Forum

-OPZIONI


amivaleo
 Share

Recommended Posts

IMPORTANTE: A causa delle modifiche apportate al Game_System non potete caricare un salvataggio preesistente se questo è stato salvato quando non avevate inserito questo script. In altre parole, dopo aver inserito questo script, le informazioni che vengono salvate nel file di salvataggio sono superiori a quelle salvate di default. Se caricate un file che non contiene queste informazioni (quindi, risalente a quando NON avevate questo script), il programma resituirà un errore

 

ecco perchè quell'errore con il file di salvataggio.

 

per la questione dell'audio... boh. ora funziona tutto. e stavolta ne sono sicuro al 1000 per 100!

se ancora non ti funziona, chiedo di cancellare il topic .-.

 

EDIT:

ah, comunque ho aggiornato il primo post. dà una controllatina adesso.

Edited by Ziel van Brand
Link to comment
Share on other sites

  • 7 months later...
inserisci il main di dad che trovi in questo forum e si risolve qualsiasi problema.

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

Mi sa che ho trovato un bug. Pur settando diversi valori invece che 100 quando si va nel menù ( settandoli dallo script) sono come sempre, uno a 100 e l' altro a 80.

Inoltre, cosa molto più fastidiosa, un solo comando cambia bgm bgs e un altro ancora. Ma molte volte il bgs deve essee sottotono rispetto al bgm, cosa che in questo modo non è più possibile.

Link to comment
Share on other sites

  • 1 year later...

Scusate il necropost, ma qualcuno potrebbe darmi una mano perchè non mi funziona l'opzione del BGM. Quelle per i SE e le windowskins funzionano, ma quella no. E' un po strano, no? Grazie in anticipo!

 

Lascio lo script nel caso ci fosse qualche errore...

 

 

#======================================================================

========

# ■ Window_Base

#==============================================================================

 

class Window_Base

#--------------------------------------------------------------------------

def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )

self.contents.fill_rect(x, y, width, height, Color.new(0,0,0,255))

now = now > max ? max : now

percentage = max != 0 ? (width) * now / max.to_f : 0

if start_color == end_color

self.contents.fill_rect(x, y, percentage, height, start_color)

else

for i in 0..percentage-1

r = start_color.red + (end_color.red - start_color.red) / percentage * i

g = start_color.green + (end_color.green - start_color.green) / percentage * i

b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i

a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i

self.contents.fill_rect(x+i, y, 1, height, Color.new(r, g, b, a))

end

end

end

#--------------------------------------------------------------------------

end

 

 

#==============================================================================

# ■ Window_Option

#==============================================================================

 

class Window_Option < Window_Base

#--------------------------------------------------------------------------

def initialize

super(6*32, 128, 13*32+16, 2*24+32)

self.contents = Bitmap.new(width - 32, height - 32)

self.contents.font.name = $fontface

self.contents.font.size = $fontsize

refresh

end

#--------------------------------------------------------------------------

def refresh

self.contents.clear

 

self.contents.fill_rect(20, 0+10, 200, 6, Color.new(0, 0, 0, 255))

self.contents.fill_rect(20, 24+10, 200, 6, Color.new(0, 0, 0, 255))

 

draw_meter($game_system.se_volume, 100, 21, 1+10, 198, 4, Color.new(255, 255, 255, 255))

draw_meter($game_system.me_volume, 100, 21, 25+10, 198, 4, Color.new(255, 255, 255, 255))

 

self.contents.font.color = normal_color

self.contents.draw_text(0, 0, width-32, 24, "0")

self.contents.draw_text(224, 0, 32, 24, "100")

self.contents.draw_text(0, 0, width-32-2, 24, $game_system.se_volume.to_s + "/ 100", 2)

 

self.contents.draw_text(0, 24, width-32, 24, "0")

self.contents.draw_text(224, 24, 32, 24, "100")

self.contents.draw_text(0, 24, width-32-2, 24, $game_system.me_volume.to_s + "/ 100", 2)

end

#--------------------------------------------------------------------------

end

 

 

#==============================================================================

# ■ Window_OptionCommand

#==============================================================================

 

class Window_OptionCommand < Window_Selectable

#--------------------------------------------------------------------------

def initialize

super(16, 160, 5*32, 4*24+32)

@commands = ["Suoni", "Musica", "Finestre", "Predefinito"]

@description = ["Modifica il volume dei suoni",

"Modifica il volume della musica",

"Cambia la grafica corrente delle finestre",

"Applica le impostazioni predefinite"]

@item_max = 4

@column_max = 1

self.contents = Bitmap.new(width - 32, height-32)

self.contents.font.name = $fontface

self.contents.font.size = $fontsize

for i in 0..(@item_max-1)

draw_item(i, normal_color)

end

self.z = 200

self.index = 0

end

#--------------------------------------------------------------------------

def draw_item(index, color)

self.contents.font.color = color

rect = Rect.new(0, 24*index, width-32, 24)

self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

self.contents.draw_text(rect, @commands[index], 1)

end

#--------------------------------------------------------------------------

def update_help

@help_window.set_text(@description[index], 1)

end

#--------------------------------------------------------------------------

def update_cursor_rect

self.cursor_rect.set(0, 24*index, width-32, 24)

end

#--------------------------------------------------------------------------

end

 

 

#==============================================================================

# ■ Window_Windowskin

#==============================================================================

 

class Window_Windowskin < Window_Selectable

#--------------------------------------------------------------------------

def initialize

super(6*32, 128+3*24+8, 13*32+16, 32+64)

self.contents = Bitmap.new(width - 32, height - 32)

self.index = -1

self.active = false

@column_max = @item_max = 3#ZVB# Inserisci il numero di windowskin presenti nell'omonima cartella

refresh

end

#--------------------------------------------------------------------------

def refresh

self.contents.clear

for i in 0..@item_max-1

x = i % @column_max * (width-32)/@column_max

y = i / @column_max * 64

bitmap = RPG::Cache.windowskin("Windowskin#{i + 1}")

self.contents.blt(x, y, bitmap, Rect.new(64, 0, 128, 64), 255)

end

end

#--------------------------------------------------------------------------

def update_cursor_rect

x = index % @column_max * (width-32)/@column_max

y = index / @column_max * 64

if @index < 0

self.cursor_rect.empty

else

self.cursor_rect.set(x, y, 128, 64)

end

end

#--------------------------------------------------------------------------

end

 

 

#==============================================================================

# ■ Scene_Option

#==============================================================================

 

class Scene_Option

#--------------------------------------------------------------------------

def initialize(index=0)

@index = index

end

#--------------------------------------------------------------------------

def main

@command_window = Window_OptionCommand.new

@help_window = Window_Help.new

@command_window.help_window = @help_window

@option_window = Window_Option.new

@windowskin_window = Window_Windowskin.new

@se_regulation = false

@me_regulation = false

Graphics.transition

loop do

Graphics.update

Input.update

update

if $scene != self

break

end

end

Graphics.freeze

@help_window.dispose

@command_window.dispose

@option_window.dispose

@windowskin_window.dispose

end

#--------------------------------------------------------------------------

def update

@help_window.update

@command_window.update

@option_window.update

@windowskin_window.update

if @command_window.active

@command_window.help_window = @help_window

update_command

return

end

if @windowskin_window.active

@help_window.set_text("Seleziona la grafica delle finestre")

update_windowskin

return

end

if @se_regulation == true

update_se_regulation

end

if @me_regulation == true

update_me_regulation

end

end

#--------------------------------------------------------------------------

def update_command

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

$scene = Scene_Menu.new(4)

return

end

if Input.trigger?(Input::C)

case @command_window.index

when 0

$game_system.se_play($data_system.decision_se)

@command_window.active = false

@se_regulation = true

when 1

$game_system.se_play($data_system.decision_se)

@command_window.active = false

@me_regulation = true

when 2

$game_system.se_play($data_system.decision_se)

@command_window.active = false

@windowskin_window.index = 0

@windowskin_window.active = true

when 3

$game_system.se_play($data_system.decision_se)

$game_system.se_volume = 100#ZVB#cambia il valore 100 per settare il volume di default per i SE

$game_system.me_volume = 80#ZVB#cambia il valore 80 per settare il volume di default per i ME,BGM,BGS

$game_system.windowskin_name = $data_system.windowskin_name = "windowskin2"#ZVB#la windowskin1 è la windowskin di default

@option_window.refresh

end

return

end

end

#--------------------------------------------------------------------------

def update_se_regulation

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

@se_regulation = false

@command_window.active = true

return

end

if Input.trigger?(Input::C)

$game_system.se_play($data_system.decision_se)

@se_regulation = false

@command_window.active = true

return

end

if Input.repeat?(Input::RIGHT) and $game_system.se_volume < 100

$game_system.se_play($data_system.cursor_se)

$game_system.se_volume += 1

@option_window.refresh

end

if Input.repeat?(Input::LEFT) and $game_system.se_volume > 0

$game_system.se_play($data_system.cursor_se)

$game_system.se_volume -= 1

@option_window.refresh

end

end

#--------------------------------------------------------------------------

def update_me_regulation

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

@me_regulation = true

@command_window.active = true

return

end

if Input.trigger?(Input::C)

$game_system.se_play($data_system.decision_se)

@me_regulation = true

@command_window.active = true

return

end

if Input.repeat?(Input::RIGHT) and $game_system.me_volume < 100

$game_system.me_volume += 1

@option_window.refresh

end

if Input.repeat?(Input::LEFT) and $game_system.me_volume > 0

$game_system.me_volume -= 1

@option_window.refresh

end

end

#--------------------------------------------------------------------------

def update_windowskin

if Input.trigger?(Input::B)

$game_system.se_play($data_system.cancel_se)

@windowskin_window.active = false

@command_window.active = true

@windowskin_window.index = -1

return

end

if Input.trigger?(Input::C)

$game_system.se_play($data_system.decision_se)

$data_system.windowskin_name = $game_system.windowskin_name = "Windowskin#{@windowskin_window.index + 1}"

return

end

end

#--------------------------------------------------------------------------

end

 

Link to comment
Share on other sites

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...