Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Orbital_Entertainment

[REQUEST] Help with Fortune Teller Script

Recommended Posts

Hello, I am having some frustrating issues with my fortune teller script. It's constantly giving me an error where I see to be no errors. I'm not sure if it is just giving the error on the wrong line or what, but I don't think there's an error on that line. I would like some help with this script of mine please. Any and all help is appreciated!
-Ghozt

EDIT: Error happens when you load Window_Sentence2. It says uninitialized name error.

EDIT 2: Will post Gene Selector Script once graphics are finished, or requested.
 

#==============================================================================
#  Fortune Telling Script
#   by Ghozt [OE]
#------------------------------------------------------------------------------
#  Recommendations:
#   Use with my Gene Selector Script.
#------------------------------------------------------------------------------
#  Version 1.0
#   use "$scene = Scene_Fortune.new" to call it
#   uses $game_variables[27, 28, 29]
#   $game_variables[27] is for first fortune card type
#   $game_variables[28] is for second fortune card type
#   $game_variables[29] is for final fortunes
#   $game_variables[30] is for checking if fortune has been taken yet
#------------------------------------------------------------------------------
#  Instructions:
#   Place above "Main" and below all default scripts.
#   Change any graphics that you like to your own.
#------------------------------------------------------------------------------
#   -License begin-
#
#  License:
#   You may do anything that you see fit to this script, EXCEPT...
#   credit anyone other than Ghozt [OE] as the creator.
#   
#  What is okay:
#   Adding or removing anything to this script.
#   Editing or modifying this script.
#   Redistributing this script.
#   Combining this script with another script (or scripts).
#   Choosing to credit the creator of this script.
#   Choosing to not credit the creator of this script.
#   Using this script for any commercial or non-commercial use.
#
#  What is not okay:
#   Claiming this script was created by anyone other than Ghozt [OE].
#
#   -License end-
#==============================================================================


#==============================================================================
#  Window_FortuneCommand
#------------------------------------------------------------------------------
#  This sets up the general command choices for this specific script.
#==============================================================================

class Window_FortuneCommand < Window_Selectable
  #--------------------------------------------------------------------------
  #  Object Initialization
  #   width    : window width
  #   commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(width, commands)
    # Compute window height from command quantity
    super(0, 0, width, commands.size * 32 + 32)
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    # The font size of the FortuneCommand window.
    self.contents.font.size = 24
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  #  Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  #  Draw Item
  #   index : item number
  #   color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
    # The font size of the choices text.
    self.contents.font.size = 24
  end
  #--------------------------------------------------------------------------
  #  Disable Item
  #   index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

#==============================================================================
#  Window_CardDescription1
#------------------------------------------------------------------------------
#  This controls the first CardDescription window.
#==============================================================================

class Window_CardDescription1 < Window_Base
  
  def initialize
    super(320, 112, 100, 100)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the first CardDescription window.
    self.contents.font.size = 24
    refresh
  end
  
  def refresh
    self.contents.clear
    
    # sets text bold and italic on or off
    self.contents.font.bold = false
    self.contents.font.italic = true
  end
end

#==============================================================================
#  Window_Sentence1
#------------------------------------------------------------------------------
#  This sets up the first Sentence window.
#==============================================================================

class Window_Sentence1 < Window_Base
  
  def initialize
    super(150, 48, 340, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the first Sentence window.
    self.contents.font.size = 26
    refresh
  end
  
  def refresh
    # What the first Sentence window will read.
    self.contents.draw_text(0, -20, 340, 64, "So you want a fortune telling, eh?")
  end
end

#==============================================================================
#  Window_CardDescription2
#------------------------------------------------------------------------------
#  This controls the second CardDescription window.
#==============================================================================

class Window_CardDescription2 < Window_Base
  
  def initialize
    super(320, 112, 170, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the second CardDescription window.
    self.contents.font.size = 24
    refresh
  end
  
  def refresh
    self.contents.clear
    # displays first card type
    # First card choice description
    if $game_variables[27] == 1
      self.contents.draw_text(0, -20, 340, 64, "This is the Life card.")
    # Second card choice description
    elsif $game_variables[27] == 2
      self.contents.draw_text(0, -20, 340, 64, "This is the Death card.")
    # Third card choice description
    elsif $game_variables[27] == 3
      self.contents.draw_text(0, -20, 340, 64, "This is the Money card.")
    # Fourth card choice description
    elsif $game_variables[27] == 4
      self.contents.draw_text(0, -20, 340, 64, "This is the Loathing card.")
    
    # sets text bold and italic on or off
    self.contents.font.bold = false
    self.contents.font.italic = true
    end
  end

#==============================================================================
#  Window_Sentence2
#------------------------------------------------------------------------------
#  This sets up the second Sentence window.
#==============================================================================

class Window_Sentence2 < Window_Base
  
  def initialize
    super(150, 48, 340, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the second Sentence window.
    self.contents.font.size = 26
    refresh
  end
  
  def refresh
    # What the second Sentence window will read.
    self.contents.draw_text(0, -20, 340, 64, "Please choose a card then.")
  end
end

#==============================================================================
#  Window_CardDescription3
#------------------------------------------------------------------------------
#  This controls the third CardDescription window.
#==============================================================================

class Window_CardDescription3 < Window_Base
  
  def initialize
    super(320, 112, 170, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the third CardDescription window.
    self.contents.font.size = 24
    refresh
  end
  
  def refresh
    self.contents.clear
    # displays second card type
    # First card choice description
    if $game_variables[28] == 1
      self.contents.draw_text(0, -20, 340, 64, "This is the Health card.")
    # Second card choice description
    elsif $game_variables[28] == 2
      self.contents.draw_text(0, -20, 340, 64, "This is the Disease card.")
    # Third card choice description
    elsif $game_variables[28] == 3
      self.contents.draw_text(0, -20, 340, 64, "This is the Poverty card.")
    # Fourth card choice description
    elsif $game_variables[28] == 4
      self.contents.draw_text(0, -20, 340, 64, "This is the Fame card.")
    
    # sets text bold and italic on or off
    self.contents.font.bold = false
    self.contents.font.italic = true
    end
  end

#==============================================================================
#  Window_Sentence3
#------------------------------------------------------------------------------
#  This sets up the third Sentence window.
#==============================================================================

class Window_Sentence3 < Window_Base
  
  def initialize
    super(150, 48, 340, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the third Sentence window.
    self.contents.font.size = 26
    refresh
  end
  
  def refresh
    # What the third Sentence window will read.
    self.contents.draw_text(0, -20, 340, 64, "Now choose your second card.")
  end
end

#==============================================================================
#  Window_CardDescription4
#------------------------------------------------------------------------------
#  This controls the fourth CardDescription window.
#==============================================================================

class Window_CardDescription4 < Window_Base
  
  def initialize
    super(320, 112, 170, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the fourth CardDescription window.
    self.contents.font.size = 24
    refresh
  end
  
  def refresh
    self.contents.clear
    
    # sets text bold and italic on or off
    self.contents.font.bold = false
    self.contents.font.italic = true
    # displays final fortune description
    # 1st fortune chance
    if $game_variables[29] == 1
      self.contents.draw_text(0, -20, 340, 64, "Life and Health")
    # 2nd fortune chance  
    elsif $game_variables[29] == 2
      self.contents.draw_text(0, -20, 340, 64, "Life and Poverty")
    # 3rd fortune chance  
    elsif $game_variables[29] == 3
      self.contents.draw_text(0, -20, 340, 64, "Life and Fame")
    # 4th fortune chance  
    elsif $game_variables[29] == 4
      self.contents.draw_text(0, -20, 340, 64, "Death and Disease")
    # 5th fortune chance  
    elsif $game_variables[29] == 5
      self.contents.draw_text(0, -20, 340, 64, "Death and Poverty")
    # 6th fortune chance  
    elsif $game_variables[29] == 6
      self.contents.draw_text(0, -20, 340, 64, "Death and Fame")
    # 7th fortune chance  
    elsif $game_variables[29] == 7
      self.contents.draw_text(0, -20, 340, 64, "Money and Health")
    # 8th fortune chance  
    elsif $game_variables[29] == 8
      self.contents.draw_text(0, -20, 340, 64, "Money and Disease")
    # 9th fortune chance  
    elsif $game_variables[29] == 9
      self.contents.draw_text(0, -20, 340, 64, "Money and Fame")
    # 10th fortune chance  
    elsif $game_variables[29] == 10
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Health")
    # 11th fortune chance  
    elsif $game_variables[29] == 11
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Disease")
    # 12th fortune chance  
    elsif $game_variables[29] == 12
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Poverty")  
      end
    end
  end
end

#==============================================================================
#  Window_Sentence4
#------------------------------------------------------------------------------
#  This sets up the fourth Sentence window.
#==============================================================================

class Window_Sentence4 < Window_Base
  
  def initialize
    super(150, 48, 340, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    # The font size of the fourth Sentence window.
    self.contents.font.size = 26
    refresh
  end
  
  def refresh
    # displays final fortune sentence
    # 1st fortune chance
    if $game_variables[29] == 1
      self.contents.draw_text(0, -20, 340, 64, "Life and Health")
    # 2nd fortune chance  
    elsif $game_variables[29] == 2
      self.contents.draw_text(0, -20, 340, 64, "Life and Poverty")
    # 3rd fortune chance  
    elsif $game_variables[29] == 3
      self.contents.draw_text(0, -20, 340, 64, "Life and Fame")
    # 4th fortune chance  
    elsif $game_variables[29] == 4
      self.contents.draw_text(0, -20, 340, 64, "Death and Disease")
    # 5th fortune chance  
    elsif $game_variables[29] == 5
      self.contents.draw_text(0, -20, 340, 64, "Death and Poverty")
    # 6th fortune chance  
    elsif $game_variables[29] == 6
      self.contents.draw_text(0, -20, 340, 64, "Death and Fame")
    # 7th fortune chance  
    elsif $game_variables[29] == 7
      self.contents.draw_text(0, -20, 340, 64, "Money and Health")
    # 8th fortune chance  
    elsif $game_variables[29] == 8
      self.contents.draw_text(0, -20, 340, 64, "Money and Disease")
    # 9th fortune chance  
    elsif $game_variables[29] == 9
      self.contents.draw_text(0, -20, 340, 64, "Money and Fame")
    # 10th fortune chance  
    elsif $game_variables[29] == 10
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Health")
    # 11th fortune chance  
    elsif $game_variables[29] == 11
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Disease")
    # 12th fortune chance  
    elsif $game_variables[29] == 12
      self.contents.draw_text(0, -20, 340, 64, "Loathing and Poverty") 
      end
    end
  end
end

#==============================================================================
#  Scene_Fortune
#------------------------------------------------------------------------------
#  This sets up what the opening fortune telling will be.
#==============================================================================

class Scene_Fortune
  
  def main
    
    # The names of your confirmation choices.
    m1 = "Yes"
    m2 = "No"
    
    @command_window = Window_FortuneCommand.new(170, [m1, m2])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription1.new
    @sentence_window = Window_Sentence1.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
    
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
    end
    
    if Input.trigger?(Input::C)
      
      case @command_window.index
      when 0
        # result of the first confirmation choice.
        $game_system.se_play($data_system.decision_se)
        @carddescription_window.refresh
        $scene = Scene_FortuneCards.new
      when 1
        # result of the second confirmation choice.
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Map.new
      end
      return
      end
    end
  end

#==============================================================================
#  Scene_FortuneCards
#------------------------------------------------------------------------------
#  This sets up what happens for the first confirmation choice.
#==============================================================================

class Scene_FortuneCards
  
  def main
    
    # The names of your first fortune card types.
    m1 = "Life"
    m2 = "Death"
    m3 = "Money"
    m4 = "Loathing"
    m5 = "Confirm"
    
    @command_window = Window_FortuneCommand.new(170, [m1, m2, m3, m4, m5])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription2.new
    @sentence_window = Window_Sentence2.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
    
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_Fortune.new
    end
    
    if Input.trigger?(Input::C)
      
      case @command_window.index
      when 0
        # Graphic and variable set for the first card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[27] = 1
        @carddescription_window.refresh
      when 1
        # Graphic and variable set for the second card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[27] = 2
        @carddescription_window.refresh
      when 2
        # Graphic and variable set for the third card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[27] = 3
        @carddescription_window.refresh
      when 3
        # Graphic and variable set for the fourth card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[27] = 4
        @carddescription_window.refresh
      when 4
        # Checks if first card variable is 1
        if $game_variables[27] == 1
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_FortuneCards2L.new
        # Checks if second card variable is 2
        elsif $game_variables[27] == 2
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_FortuneCards2D.new
        # Checks if third card variable is 3
        elsif $game_variables[27] == 3
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_FortuneCards2M.new
        # Checks if fourth card variable is 4
        elsif $game_variables[27] == 4
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_FortuneCards2F.new
      end
      return
      end
    end
  end
end  

#==============================================================================
#  Scene_FortuneCards2L
#------------------------------------------------------------------------------
#  This sets up what happens after you choose the first card type choice.
#==============================================================================

class Scene_FortuneCards2L
  
  def main
    
    # The names of your second fortune card types.
    s1 = "Health"
    s2 = "Poverty"
    s3 = "Fame"
    s4 = "Confirm"
    
    @command_window = Window_FortuneCommand.new(170, [s1, s2, s3, s4])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription3.new
    @sentence_window = Window_Sentence3.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
  
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards.new
    end
    
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        # Graphic and variable set for the first card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 1
        $game_variables[29] = 1
        @carddescription_window.refresh
      when 1
        # Graphic and variable set for the second card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 3
        $game_variables[29] = 2
        @carddescription_window.refresh
      when 2
        # Graphic and variable set for the third card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 4
        $game_variables[29] = 3
        @carddescription_window.refresh
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_FortuneCards3.new
      end
      return
    end
  end
end

#==============================================================================
#  Scene_FortuneCards2D
#------------------------------------------------------------------------------
#  This sets up what happens after you choose the second card type choice.
#==============================================================================

class Scene_FortuneCards2D
  
  def main
    
    # The names of your second fortune card types.
    s1 = "Disease"
    s2 = "Poverty"
    s3 = "Fame"
    s4 = "Confirm"
    
    @command_window = Window_FortuneCommand.new(170, [s1, s2, s3, s4])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription3.new
    @sentence_window = Window_Sentence3.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
  
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards.new
    end
    
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0
        # Graphic and variable set for the first card.
        $game_system.se_play($data_system.decision_se)        
        $game_variables[28] = 2
        $game_variables[29] = 4
        @carddescription_window.refresh
      when 1
        # Graphic and variable set for the second card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 3
        $game_variables[29] = 5
        @carddescription_window.refresh
      when 2
        # Graphic and variable set for the third card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 4
        $game_variables[29] = 6
        @carddescription_window.refresh
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_FortuneCards3.new
      end
      return
    end
  end
end

#==============================================================================
#  Scene_FortuneCards2M
#------------------------------------------------------------------------------
#  This sets up what happens after you choose the third card type choice.
#==============================================================================

class Scene_FortuneCards2M
  
  def main
    
    # The names of your second fortune card types.
    s1 = "Health"
    s2 = "Disease"
    s3 = "Fame"
    s4 = "Confirm"
    
    @command_window = Window_FortuneCommand.new(170, [s1, s2, s3, s4])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription3.new
    @sentence_window = Window_Sentence3.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
  
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards.new
    end
    
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        # Graphic and variable set for the first card.
        $game_system.se_play($data_system.decision_se)        
        $game_variables[28] = 1
        $game_variables[29] = 7
        @carddescription_window.refresh
      when 1
        # Graphic and variable set for the second card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 2
        $game_variables[29] = 8
        @carddescription_window.refresh
      when 2
        # Graphic and variable set for the third card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 4
        $game_variables[29] = 9
        @carddescription_window.refresh
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_FortuneCards3.new
      end
      return
    end
  end
end

#==============================================================================
#  Scene_FortuneCards2F
#------------------------------------------------------------------------------
#  This sets up what happens after you choose the fourth card type choice.
#==============================================================================

class Scene_FortuneCards2F
  
  def main
    
    # The names of your second fortune card types.
    s1 = "Health"
    s2 = "Disease"
    s3 = "Poverty"
    s4 = "Confirm"
    
    @command_window = Window_FortuneCommand.new(170, [s1, s2, s3, s4])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription3.new
    @sentence_window = Window_Sentence3.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
  
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards.new
    end
    
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        # Graphic and variable set for the first card.
        $game_system.se_play($data_system.decision_se)        
        $game_variables[28] = 1
        $game_variables[29] = 10
        @carddescription_window.refresh
      when 1
        # Graphic and variable set for the second card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 2
        $game_variables[29] = 11
        @carddescription_window.refresh
      when 2
        # Graphic and variable set for the third card.
        $game_system.se_play($data_system.decision_se)
        $game_variables[28] = 3
        $game_variables[29] = 12
        @carddescription_window.refresh
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_FortuneCards3.new
      end
      return
    end
  end
end

#==============================================================================
#  Scene_FortuneCards3
#------------------------------------------------------------------------------
#  This sets up what happens after your second card type choice.
#==============================================================================

class Scene_FortuneCards3
  
  def main
    
    # The names of your last choices.
    s1 = "Done"
    
    @command_window = Window_FortuneCommand.new(170, [s1])
    @command_window.x = 150
    @command_window.y = 112
    
    @carddescription_window = Window_CardDescription4.new
    @sentence_window = Window_Sentence4.new
    
    Graphics.transition
    
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @command_window.dispose
    @carddescription_window.dispose
    @sentence_window.dispose
  
  end

  def update
    
    @command_window.update
    @carddescription_window.update
    @sentence_window.update
    
    if Input.trigger?(Input::B)
      if $game_variables[27] == 1
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards2L.new
    elsif $game_variables[27] == 2
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards2D.new
    elsif $game_variables[27] == 3
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards2M.new
    elsif $game_variables[27] == 4
      $game_system.se_play($data_system.buzzer_se)
      $scene = Scene_FortuneCards2F.new
    end
    
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $game_variables[30] = 1
        $scene = Scene_Map.new
      end
      return
      end
    end
  end
end

Edited by Orbital_Entertainment

Share this post


Link to post
Share on other sites

Found your problem.

You missed a couple of end calls at the bottom of your elsif trees, that ruined the variable scope.

The program was confused because it defined the classes as sub classes in another class, and you get the undefined error because there was no class defined in the global scope with the name you needed.

And the reason it didn't give you a syntax error message instead, is because you put extra end commands in the wrong places, tricking the compiler to think that the syntax is alright.

So the bottom line is: add end commands on lines 174 and 234 and remove the end commands on lines 322 and 381

Share this post


Link to post
Share on other sites

Thank you so much Saltome! It works great! I have discovered another bug, but I'm sure it's completely my fault, no worries. When you go to click "Done" to finish the fortune telling, it doesn't work. It's suppose to send you back to Scene_Map.new, but doesn't, weird. But thank you so very much! You're a great help Saltome!
-Ghozt

Share this post


Link to post
Share on other sites

Strictly speaking all bugs are made by people.

I noticed the problem, but didn't know if it was intended or not.

And the problem again is the wrong scope.

You have two nested conditional branches, but you only close the internal branch in time.

This resulted in the branch INPUT::C to be inside the INPUT::B, needless to say that makes it impossible to fulfill.

To fix it put another end on line 940 and remove the one on line 949

Share this post


Link to post
Share on other sites

Strictly speaking all bugs are made by people.

I noticed the problem, but didn't know if it was intended or not.

And the problem again is the wrong scope.

You have two nested conditional branches, but you only close the internal branch in time.

This resulted in the branch INPUT::C to be inside the INPUT::B, needless to say that makes it impossible to fulfill.

To fix it put another end on line 940 and remove the one on line 949

Thank you so much Saltome! I'll definitely credit you for your assistance!

-Ghozt

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...