Я не знаю, что мне с этим скриптом сделать, чтобы он работал и даже не могу понять, с какой стороны подступиться к нему, чтобы узнать, в чем состоит ошибка.
Скрипт разбит на несколько частей, приведу только те, которые нужны для проверки, в чем дело.
module DEFFFIIREM_Vocab
# ---------------------------------------
# TITLE MENU
NEW_GAME = 'Новая игра'
LOAD_GAME = 'Загрузить игру'
EXIT_GAME = 'Выход'
# ---------------------------------------
# IN-GAME MENU
MENU_ITEM = 'Предмет'
MENU_ITEMS = 'Предметы'
MENU_MAGIC = 'Магия'
MENU_EQUIPMENT = 'Снаряжение'
MENU_STATUS = 'Статус'
MENU_FORMATION = 'Расположение'
MENU_KEY_TERMS = 'Словарь'
MENU_CONFIG = 'Настройки'
MENU_SAVE = 'Сохранить'
# ---------------------------------------
# ITEMS MENU
ITEMS_USE = 'Использовать'
ITEMS_SORT = 'Сортировать'
# ---------------------------------------
# MAGIC MENU
MAGIC_DISCARD = 'Забыть'
# ---------------------------------------
# EQUIPMENT MENU
EQUIPMENT_EQUIP = 'Надеть'
EQUIPMENT_OPTIMAL = 'Оптимальное'
EQUIPMENT_BEST_ARMOR = 'Наилучшее'
EQUIPMENT_L_HAND = 'Лев. рука'
EQUIPMENT_R_HAND = 'Прав. рука'
EQUIPMENT_HEAD = 'Шлем'
EQUIPMENT_BODY = 'Тело'
EQUIPMENT_HANDS = 'Наручи'
end
class DEFFFIIREM_MenuBase
def initialize
Graphics.transition
@disposed=false
end
def main
Graphics.update
Input.update
update
dispose if $scene!=self
end
def update
end
def dispose
if not disposed?
Graphics.freeze
instance_variables.each do |varname|
ivar = instance_variable_get(varname)
ivar.dispose if ivar.is_a?(Window)
ivar.dispose if ivar.is_a?(Sprite)
ivar.dispose if ivar.is_a?(Spriteset_Map)
end
disposed=true
end
end
def disposed=(value)
@disposed=value
end
def disposed?
@disposed
end
def start_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
def init_gfx_and_audio
if $scene.is_a?(Scene_Title)
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
end
Graphics.transition
end
def audio_fadeout
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
end
def load_database
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
end
def battle_test
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_party.setup_battle_test_members
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
$game_system.se_play($data_system.battle_start_se)
$game_system.bgm_play($game_system.battle_bgm)
$scene = Scene_Battle.new
end
end
А вот код с ошибкой:
class DEFFFIIREM_Menu < DEFFFIIREM_MenuBase
def initialize
init_gfx_and_audio
pose_all_windows
end
def pose_all_windows
pose_commands
end
def pose_commands
@command_window = Window_Command.new(192,[
DEFFFIIREM_Vocab::MENU_ITEMS,
DEFFFIIREM_Vocab::MENU_MAGIC,
DEFFFIIREM_Vocab::MENU_EQUIPMENT,
DEFFFIIREM_Vocab::MENU_STATUS,
DEFFFIIREM_Vocab::MENU_FORMATION,
DEFFFIIREM_Vocab::MENU_KEY_TERMS,
DEFFFIIREM_Vocab::MENU_CONFIG,
DEFFFIIREM_Vocab::MENU_SAVE
])
@command_window.x=640-@command_window.width
@command_window.active=true
end
def update
@command_window.update
if Input.trigger? (Input::B) then
$scene=Scene_Map.new
end
end
end
Конкретно сама ошибка заключается в том, что
@command_window.update не дает никакого эффекта и окно не обновляется. Может быть, так оно работает только у меня, но я бы не стал на это рассчитывать.
Для вызова этого меню следует вызвать следующий скрипт из события: $scene=DEFFFIIREM_Menu.new