Also ich möchte über das Menu eine funktion einbauen womit ich den Switch
für meine Minimap an und ausmachen kann.
un der der Menüpunkt müsste über Speichern liegen
hab mir das ungefähr so vorgestellt
wenn Switch 2=ON then
*angezeigter text im Menu = 'Minimap [aus]
switch 2=OFF
else
*angezeigter text im Menu = 'Minimap [an]
switch 2=ON
--Hier mal Screen von der Minimap--
--Mag nähmlich nicht immer ins Inventer unt ein Item benutzen mit einer Show Choice--
(http://filesupload.fi.funpic.de/incoming/40667477Beispiel.PNG)
------------
Hab mich mal selbst dran probiert.
Man sieht jetzt zwar alles korrekt,
aber wenn ich den Menüpunkt auswähle passiert garnichts
(noch nichtmal ein Error^^)
Bild:
(http://filesupload.fi.funpic.de/incoming/25028393Beispiel.PNG)
Hier der Code
#==============================================================================
# ¦ Scene_Menu
#------------------------------------------------------------------------------
# ??????????????????
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# ? ?????????
# menu_index : ?????????????
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
end
#--------------------------------------------------------------------------
# ? ????
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# ? ????????????
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
if $game_switches[2] == true
s5 = "Minimap [an]"
else
s5 = "Minimap [aus]"
end
s6 = Vocab::save
s7 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.members.size == 0 # ??????? 0 ????
@command_window.draw_item(0, false) # ????????
@command_window.draw_item(1, false) # ???????
@command_window.draw_item(2, false) # ??????
@command_window.draw_item(3, false) # ?????????
end
if $game_system.save_disabled # ????????
@command_window.draw_item(4, false) # ???????
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # ????
$scene = Scene_Item.new
when 1,2,3 # ????????????
start_actor_selection
when 4
if $game_switches[2] == true
$game_switches[2] == false
else
$game_switches[2] == true
end
when 5 # ???
$scene = Scene_File.new(true, false, false)
when 6 # ?????
$scene = Scene_End.new
end
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def start_actor_selection
@command_window.active = false
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def end_actor_selection
@command_window.active = true
@status_window.active = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when 1 # ???
$scene = Scene_Skill.new(@status_window.index)
when 2 # ??
$scene = Scene_Equip.new(@status_window.index)
when 3 # ?????
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
mfg Caith
when 4
if $game_switches[2] == true
$game_switches[2] == false
else
$game_switches[2] == true
end== ist zum vergleichen da. = hingegen zum Zuweisen und da du den Switch 2 den Wert true zuweisen willst müsstest du hier = schreiben.when 4
if $game_switches[2] == true
$game_switches[2] = false
else
$game_switches[2] = true
endHab das mit der Minimapoption mal erledigt für dich:#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# * Create command window
#--------------------------------------------------------------------------
def create_command_window
c = []
c[0] = Vocab::item
c[1] = Vocab::skill
c[2] = Vocab::equip
c[3] = Vocab::status
if $game_switches[2]
c[4] = "Minimap [EIN]"
else
c[4] = "Minimap [AUS]"
end
c[5] = Vocab::save
c[6] = Vocab::game_end
@command_window = Window_Command.new(160, c)
@command_window.index = @menu_index
if $game_party.members.size == 0
@command_window.draw_item(0, false)
@command_window.draw_item(1, false)
@command_window.draw_item(2, false)
@command_window.draw_item(3, false)
end
if $game_system.save_disabled
@command_window.draw_item(5, false)
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
if $game_switches[2] # == true kann man bei if wegelassen
$game_switches[2] = false # nur ein =, da es eine Zuweisung ist
else
$game_switches[2] = true
end
@command_window.dispose # altes ausblenden
@menu_index = @command_window.index # alter index den neuen zuweisen
create_command_window # neues erstellen
when 5
$scene = Scene_File.new(true, false, false)
when 6
$scene = Scene_End.new
end
end
end
end
Außerdem würde ich in ca. Zeile 42 von Scene_End die 5 mit 6 austauschen und in Scene_File in ca. 54 die 4 durch ne 5 ersetzen.