AbyssalLord
Member
I was making a script for a new game I'm working on, but I keep getting an error message saying something like: 'argument error line 27 (4 for 0)'
That is the line under def initialize that says 'super(0,0,620,300)'
Of course, I looked it over and I cannot find an error there, which leads me to believe that it's somewhere else in the script. I looked through the entire script, but I just could not find it. So, I'm posting the script here in hopes that someone will be willing to help me find the error. I went through the entire script and commented everything to make it easier for whoever decides to help me (if anyone has the time). I would greatly appreciate any help you can offer. Thanks!
Here's the code:
Thanks again!
That is the line under def initialize that says 'super(0,0,620,300)'
Of course, I looked it over and I cannot find an error there, which leads me to believe that it's somewhere else in the script. I looked through the entire script, but I just could not find it. So, I'm posting the script here in hopes that someone will be willing to help me find the error. I went through the entire script and commented everything to make it easier for whoever decides to help me (if anyone has the time). I would greatly appreciate any help you can offer. Thanks!
Here's the code:
Code:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Class Description Window by AbyssalLord
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#===============================================================================
#**Window_Class
#-------------------------------------------------------------------------------
#This displays descriptions of classes based on a variable.
#===============================================================================
class Window_Class
#-------------------------------------------------------------------------------
#Constant Variables
#-------------------------------------------------------------------------------
#CLASS_VAR - Variable ID that is used to determine which description is displayed.
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# 0 :Invisible
# 1 :Mage
# 2 :Rogue
# 3 :Warrior
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
CLASS_VAR = 6
#-------------------------------------------------------------------------------
#Object Initialize
#-------------------------------------------------------------------------------
def initialize
super(0, 0, 620, 300)
self.contents = Bitmap.new(width - 32,height - 32)
@options = $game_variables[CLASS_VAR]
refresh
end
#-------------------------------------------------------------------------------
#Refresh
#-------------------------------------------------------------------------------
def refresh
#Clear contents
self.contents.clear
reset
#return if variables does no equal 0..3
return if options != 0..3
case @options
when 0 #draw nothing
self.visible = false
when 1 #mage
self.contents.draw_text(0,0, 150, 50, "Mage", 2)
when 2 #rogue
self.contents.draw_text(0,0, 150, 50, "Rogue", 2)
when 3 #warrior
self.contents.draw_text(0,0, 150, 50, "Warrior", 2)
end
end
#-------------------------------------------------------------------------------
#Reset
#-------------------------------------------------------------------------------
def reset
@options = $game_variables[CLASS_VAR]
end
#-------------------------------------------------------------------------------
#Frame Update
#-------------------------------------------------------------------------------
def update
super
refresh if ( @options != $game_variables[CLASS_VAR] )
end
end
#===============================================================================
#**Scene_Map
#-------------------------------------------------------------------------------
# This class performs map screen processing.
#===============================================================================
class Scene_Map
#-------------------------------------------------------------------------------
#Alias Methods
#-------------------------------------------------------------------------------
alias d_main main
alias d_update update
#-------------------------------------------------------------------------------
#Main Processing
#-------------------------------------------------------------------------------
def main
@d = Window_Class.new
d_main
@d.dispose
end
#-------------------------------------------------------------------------------
#Frame Update
#-------------------------------------------------------------------------------
def update
@d.update
d_update
end
end
Thanks again!