Dieses Script erlaubt es die Party auszutauschen (like Baldurs Gate Dark Alliance oder Champions of Norrath).
Ich werde das Script vielleicht noch etwas aufbessern.
Aufrufen: $scene = Scene_PartyEI.new
Script Version 1.0 :
#############################Party Import/Export Script####################################
# scripted by PDM
# Version 1.0
# Dieses Script erlaubt dir die Party auszutauschen. Alle PArtyeinstellungen werden übernommen.
#####################################################################################
Datei = "Party"
Endung = ".host"
Ordner = "Dateien"
####################################
class Scene_PartyEI < Scene_Base
def initialize(a_index = 0)
@a_index = a_index
end
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@party_window = Window_PartyEI.new(160, 0)
end
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@party_window.dispose
end
def update
super
update_menu_background
@command_window.update
@gold_window.update
@party_window.update
update_command_selection
end
def create_command_window
s1 = "Exportieren"
s2 = "Importieren"
s3 = "Abbrechen"
@command_window = Window_Command.new(150, [s1, s2, s3])
@command_window.index = @a_index
end
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
case @command_window.index
when 0
Sound.play_decision
file = File.open("#{Ordner}/#{Datei}#{Endung}", "wb")
Marshal.dump($game_party, file)
file.close
$scene = Scene_Map.new
when 1
Sound.play_decision
if File.exist?("#{Ordner}/#{Datei}#{Endung}")
file = File.open("#{Ordner}/#{Datei}#{Endung}", "rb")
$game_party = Marshal.load(file)
file.close
$game_player.refresh
$scene = Scene_Map.new
else
Sound.play_buzzer
end
when 2
Sound.play_cancel
$scene = Scene_Map.new
end
end
end
end
class Window_PartyEI < Window_Base
def initialize(x, y)
super(x, y, 384, 416)
refresh
self.active = false
self.opacity = 0
end
def refresh
self.contents.clear
@item_max = $game_party.members.size
for actor in $game_party.members
draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
x = 104
y = actor.index * 96 + WLH / 2
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 120, y)
draw_actor_level(actor, x, y + WLH * 1)
draw_actor_state(actor, x, y + WLH * 2)
draw_actor_hp(actor, x + 120, y + WLH * 1)
draw_actor_mp(actor, x + 120, y + WLH * 2)
end
end
end