Vorwort:
Dachte mir, dass das relativ nützlich wäre und einige gebrauchen könnten, also habe ich mich mal rangesetzt. Ihr braucht für das Script nur die neuste Version der Ya² - Engine (http://picbooks.net/image_-571720098_ya2_gameover.jpg) Und das Windowskin, was ihr bei "Zusätze" findet. Dieses einfach in den Ordner "System" eures Spieleordners kopieren. Das Script bewirkt, dass man eine Gameover-Auswahl in seinem Gameover-Screen hat. (Siehe Zusätze)
Einbauen lässt es sich wie jedes andere Script auch (meistens):
Ein neues Script über Main erstellen und in dieses das Script einfügen.
Zusätze:
(http://picbooks.net/image_-571720098_ya2_gameover.jpg)
(http://picbooks.net/image_-220399177_choice.png)
Script:
#==============================================================================
# ¦ Scene_Gameover
#------------------------------------------------------------------------------
# Laden und Beenden Auswahl
# Erstellt von Yatzumo
# > Vorraussetzung: Ya² - Engine (Mindestens Version 1.5)
# > Version: 1.0
#==============================================================================
class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# ? Scene starten
#--------------------------------------------------------------------------
def start
super
RPG::BGM.stop
RPG::BGS.stop
$data_system.gameover_me.play
Graphics.transition(20)
Graphics.freeze
check_continue
create_gameover_graphic
init_ya²_engine
create_command_choice
end
#--------------------------------------------------------------------------
# ? Bei Scene-Ende, alles löschen
#--------------------------------------------------------------------------
def terminate
super
dispose_gameover_graphic
dispose_commands
$scene = nil if $BTEST
end
#--------------------------------------------------------------------------
# ? Scene Updaten
#--------------------------------------------------------------------------
def update
super
update_choice
update_keypress
end
#--------------------------------------------------------------------------
# ? Übergang einführen
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(20)
end
#--------------------------------------------------------------------------
# ? Gameover Grafik erstellen
#--------------------------------------------------------------------------
def create_gameover_graphic
@sprite = Sprite.new
@sprite.bitmap = Cache.system("GameOver")
@sprite.z = 800
end
#--------------------------------------------------------------------------
# ? Ya² - Engine initialisieren
#--------------------------------------------------------------------------
def init_ya²_engine
$yawin.init
$yapic.init
$yatex.init
end
#--------------------------------------------------------------------------
# ? Auswahl erstellen:
#--------------------------------------------------------------------------
def create_command_choice
lade = Vocab::continue
titel = Vocab::to_title
beende = Vocab::shutdown
textgroß = Array.new
textgroß[0] = lade.size.to_f
textgroß[1] = titel.size.to_f
textgroß[2] = beende.size.to_f
@size = 20
if textgroß[0] > textgroß[1] and textgroß[0] > textgroß[2]
@width = textgroß[0] * (@size / 2) + 10
elsif textgroß[1] > textgroß[0] and textgroß[1] > textgroß[2]
@width = textgroß[1] * (@size / 2) + 10
elsif textgroß[2] > textgroß[1] and textgroß[2] > textgroß[0]
@width = textgroß[2] * (@size / 2) + 10
end
@x = (544 / 2) - (@width / 2)
@choice_switch = true
@choice = 0
@choice_opacity = 0
$yawin.show(1, @x, 250, @width, ((@size + 2) * 3) + 18, 801, 180, 0, 255)
if @continue_enabled
$yatex.show(1, lade, 0, 1, 0, @size, @x, 261, @width, @size + 2, 802, 250)
else
$yatex.show(1, lade, 0, 1, 8, @size, @x, 261, @width, @size + 2, 802, 250)
end
$yatex.show(2, titel, 0, 1, 0, @size, @x, 283, @width, @size + 2, 802, 250)
$yatex.show(3, beende, 0, 1, 0, @size, @x, 305, @width, @size + 2, 802, 250)
$yawin.show(2, @x + 9, 261, @width - 18, @size + 2, 803, 100, "choice", 0)
end
#--------------------------------------------------------------------------
# ? Auswahlanzeige updaten
#--------------------------------------------------------------------------
def update_choice
if @choice == 0
y = 261
elsif @choice == 1
y = 283
elsif @choice == 2
y = 305
end
if @choice_switch == true and @choice_opacity <= 250
@choice_opacity += 10
$yawin.show(2, @x + 9, y, @width - 18, @size + 2, 803, 100, "choice", @choice_opacity)
if @choice_opacity == 250
@choice_switch = false
else
@choice_switch = true
end
end
if @choice_switch == false and @choice_opacity >= 0
@choice_opacity -= 10
$yawin.show(2, @x + 9, y, @width - 18, @size + 2, 803, 100, "choice", @choice_opacity)
if @choice_opacity == 0
@choice_switch = true
else
@choice_switch = false
end
end
end
#--------------------------------------------------------------------------
# ? Abfragen ob Taste gedrückt wird
#--------------------------------------------------------------------------
def update_keypress
if Input.trigger?(Input::C)
if @choice == 0
if @continue_enabled
Sound.play_decision
$scene = Scene_File.new(false, true, false)
else
Sound.play_buzzer
end
elsif @choice == 1
Sound.play_decision
$scene = Scene_Title.new
Graphics.fadeout(20)
elsif @choice == 2
Sound.play_decision
$scene = nil
Graphics.fadeout(20)
end
end
if Input.trigger?(Input::DOWN)
Sound.play_cursor
if @choice == 2
@choice = 0
elsif @choice >= 0
@choice += 1
end
end
if Input.trigger?(Input::UP)
Sound.play_cursor
if @choice == 0
@choice = 2
elsif @choice <= 2
@choice -= 1
end
end
end
#--------------------------------------------------------------------------
# ? Abfragen ob Laden möglich ist
#--------------------------------------------------------------------------
def check_continue
@continue_enabled = (Dir.glob('Save*.rvdata').size > 0)
end
#--------------------------------------------------------------------------
# ? Auswahl und Fenster entfernen / löschen
#--------------------------------------------------------------------------
def dispose_commands
$yawin.disposeall
$yatex.disposeall
end
#--------------------------------------------------------------------------
# ? Gameover Grafik entfernen / löschen
#--------------------------------------------------------------------------
def dispose_gameover_graphic
@sprite.bitmap.dispose
@sprite.dispose
end
end
Viel Spaß mit dem Script!
Kritik und Verbesserungsvorschläge, sowie Dankeschön ist hier im Thread gern gesehen.
MFG Yatzumo
EDIT:
222. Post. 8)