I'm getting this error when calling a battle:
Script 'Main' line 17:NoMethodError occured.
undefined method 'main for #<Scene_Battle:0x1612ae0>
and this is my main:
Maybe it has to do something with this:
Script 'Main' line 17:NoMethodError occured.
undefined method 'main for #<Scene_Battle:0x1612ae0>
and this is my main:
Code:
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
# After defining each class, actual processing begins here.
#==============================================================================
begin
Font.default_name = "Franklin Gothic Medium"
Font.default_bold = true
#"Font.default_color = "blue"
# Prepare for transition
Graphics.freeze
# Make scene object (title screen)
$scene = Scene_Title.new
# Call main method as long as $scene is effective
while $scene != nil
$scene.main
end
# Fade out
Graphics.transition(20)
rescue Errno::ENOENT
# Supplement Errno::ENOENT exception
# If unable to open file, display message and end
filename = $!.message.sub("No such file or directory - ", "")
print("Unable to find file #{filename}.")
end
Maybe it has to do something with this:
Code:
#==============================================================================
# â– Window_Selectable
#------------------------------------------------------------------------------
#  カーソルã®ç§»å‹•ã‚„スクãƒãƒ¼ãƒ«ã®æ©Ÿèƒ½ã‚’æŒã¤ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Window_Selectable2< Window_Base
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :index # カーソルä½ç½®
attr_reader :help_window # ヘルプウィンドウ
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
# x : ウィンドウ㮠X 座標
# y : ウィンドウ㮠Y 座標
# width : ウィンドウã®å¹…
# height : ウィンドウã®é«˜ã•
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# ◠カーソルä½ç½®ã®è¨å®š
# index : æ–°ã—ã„カーソルä½ç½®
#--------------------------------------------------------------------------
def index=(index)
@index = index
# ヘルプテã‚ストを更新 (update_help ã¯ç¶™æ‰¿å…ˆã§å®šç¾©ã•ã‚Œã‚‹)
if self.active and @help_window != nil
update_help
end
# カーソルã®çŸ©å½¢ã‚’æ›´æ–°
end
#--------------------------------------------------------------------------
# ◠行数ã®å–å¾—
#--------------------------------------------------------------------------
def row_max
# é …ç›®æ•°ã¨åˆ—æ•°ã‹ã‚‰è¡Œæ•°ã‚’算出
return (@item_max + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# â— å…ˆé ã®è¡Œã®å–å¾—
#--------------------------------------------------------------------------
def top_row
# ウィンドウ内容ã®è»¢é€å…ƒ Y 座標をã€1 è¡Œã®é«˜ã• 32 ã§å‰²ã‚‹
return self.oy / 32
end
#--------------------------------------------------------------------------
# â— å…ˆé ã®è¡Œã®è¨å®š
# row : å…ˆé ã«è¡¨ç¤ºã™ã‚‹è¡Œ
#--------------------------------------------------------------------------
def top_row=(row)
# row ㌠0 未満ã®å ´åˆã¯ 0 ã«ä¿®æ£
if row < 0
row = 0
end
# row ㌠row_max - 1 超ã®å ´åˆã¯ row_max - 1 ã«ä¿®æ£
if row > row_max - 1
row = row_max - 1
end
# row ã« 1 è¡Œã®é«˜ã• 32 を掛ã‘ã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦å†…容ã®è»¢é€å…ƒ Y 座標ã¨ã™ã‚‹
self.oy = row * 32
end
#--------------------------------------------------------------------------
# â— 1 ページã«è¡¨ç¤ºã§ãる行数ã®å–å¾—
#--------------------------------------------------------------------------
def page_row_max
# ウィンドウã®é«˜ã•ã‹ã‚‰ã€ãƒ•ãƒ¬ãƒ¼ãƒ ã®é«˜ã• 32 を引ãã€1 è¡Œã®é«˜ã• 32 ã§å‰²ã‚‹
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# â— 1 ページã«è¡¨ç¤ºã§ãã‚‹é …ç›®æ•°ã®å–å¾—
#--------------------------------------------------------------------------
def page_item_max
# 行数 page_row_max 㫠列数 @column_max を掛ã‘ã‚‹
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# ◠ヘルプウィンドウã®è¨å®š
# help_window : æ–°ã—ã„ヘルプウィンドウ
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# ヘルプテã‚ストを更新 (update_help ã¯ç¶™æ‰¿å…ˆã§å®šç¾©ã•ã‚Œã‚‹)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
# カーソルã®ç§»å‹•ãŒå¯èƒ½ãªçŠ¶æ…‹ã®å ´åˆ
if self.active and @item_max > 0 and @index >= 0
# æ–¹å‘ボタンã®ä¸‹ãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::DOWN)
# 列数㌠1 ã‹ã¤ æ–¹å‘ボタンã®ä¸‹ã®æŠ¼ä¸‹çŠ¶æ…‹ãŒãƒªãƒ”ートã§ãªã„å ´åˆã‹ã€
# ã¾ãŸã¯ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ãŒ(é …ç›®æ•° - 列数)よりå‰ã®å ´åˆ
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
# カーソルを下ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end
# æ–¹å‘ボタンã®ä¸ŠãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::UP)
# 列数㌠1 ã‹ã¤ æ–¹å‘ボタンã®ä¸Šã®æŠ¼ä¸‹çŠ¶æ…‹ãŒãƒªãƒ”ートã§ãªã„å ´åˆã‹ã€
# ã¾ãŸã¯ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ãŒåˆ—数より後ã‚ã®å ´åˆ
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
# カーソルを上ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end
# æ–¹å‘ボタンã®å³ãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::RIGHT)
# 列数㌠2 以上ã§ã€ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ãŒ(é …ç›®æ•° - 1)よりå‰ã®å ´åˆ
if @column_max >= 2 and @index < @item_max - 1
# カーソルをå³ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# æ–¹å‘ボタンã®å·¦ãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::LEFT)
# 列数㌠2 以上ã§ã€ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ãŒ 0 より後ã‚ã®å ´åˆ
if @column_max >= 2 and @index > 0
# カーソルを左ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# R ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::R)
# 表示ã•ã‚Œã¦ã„る最後尾ã®è¡ŒãŒã€ãƒ‡ãƒ¼ã‚¿ä¸Šã®æœ€å¾Œã®è¡Œã‚ˆã‚Šã‚‚å‰ã®å ´åˆ
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# カーソルを 1 ページ後ã‚ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end
# L ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.repeat?(Input::L)
# 表示ã•ã‚Œã¦ã„ã‚‹å…ˆé ã®è¡ŒãŒ 0 より後ã‚ã®å ´åˆ
if self.top_row > 0
# カーソルを 1 ページå‰ã«ç§»å‹•
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end
# ヘルプテã‚ストを更新 (update_help ã¯ç¶™æ‰¿å…ˆã§å®šç¾©ã•ã‚Œã‚‹)
if self.active and @help_window != nil
update_help
end
# カーソルã®çŸ©å½¢ã‚’æ›´æ–°
end
end