RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Scripting Error (Window_Base)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 83
All that you know is at an end...
I've been working on some scripts for my project, and the other night I got this error message when I went to playtest:


I can't seem to figure out why. On line the 17, the code is as follows:

    @windowskin_name = $game_system.windowskin_name

So, yeah, I'm pretty stumped. I've attached the script file if anybody would be willing to take a look at it, and see if they can't find the problem.
« Last Edit: October 26, 2009, 04:36:36 PM by CursedBlackWolf »

*
Rep:
Level 87
Scene_Capitol is the problem.  Due to the very messy indenting, you've got an end where it shouldn't be in Scene_C_Build (line 84), and one missing from the end of the class (around line 144).  It meant part of this script was running before your game ever reached the Main script.  Here is the corrected Scene_Capitol script - just copy the lot and replace everything you've got in that script slot.

Code: [Select]
#-------------------------------------------------------------------------------
# Capitol Menu
#-------------------------------------------------------------------------------
class Scene_Capitol
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Build"
    s2 = "Progress"
    s3 = "Back"
    @spriteset = Spriteset_Map.new
    @command_window = Window_Command.new(160, [s1, s2, s3])
    @command_window.index = @menu_index
    @command_window.y = 64
    Graphics.transition
    # Make status window
    @capitol_window = Window_Capitol.new
    @capitol_window.x = 0
    @capitol_window.y = 0
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @capitol_window.dispose
  end
  def update
    @spriteset.update
    @command_window.update
    @capitol_window.update
    if @command_window.active
      update_command
      return
    end
  end
#--------update command---------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_KingMenu.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0 # Build
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Build.new
        when 1 # Progress
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Prog.new
        when 2 # Back
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_KingMenu.new
      end
      return
    end
  end
end

#-------------------------------------------------------------------------------
# Capitol Build Menu
#-------------------------------------------------------------------------------
class Scene_C_Build
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Shop"
    s2 = "Bank"
    s3 = "Inn"
    s4 = "House"
    s5 = "Back"
    @spriteset = Spriteset_Map.new
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @command_window.index = @menu_index
    @command_window.y = 64
    #end # removed
    Graphics.transition
    # Make status window
    @cbuild_window = Window_C_Build.new
    @cbuild_window.x = 160
    @cbuild_window.y = 64
    @cabuild_window = Window_Cap_Build.new
    @cabuild_window.x = 0
    @cabuild_window.y = 0
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @cbuild_window.dispose
    @cabuild_window.dispose
  end
  def update
    @spriteset.update
    @command_window.update
    @cbuild_window.update
    @cabuild_window.update
    if @command_window.active
      update_command
      return
    end
  end
#--------update command---------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Capitol.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0 # Shop
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Shop.new
        when 1 # Bank
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Bank.new
        when 2 # Inn
          $game_system.se_play($data_system.decision.se)
          $scene = Scene_C_Inn.new
        when 3 # House
          $game_system.se_play($data_system.decision.se)
          $scene = Scene_C_House.new
        when 4 # Back
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_Capitol.new
      end
      return
    end
  end # added
end


#-------------------------------------------------------------------------------
# Capitol Progress Menu
#-------------------------------------------------------------------------------
class Scene_C_Prog
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Back"
    @spriteset = Spriteset_Map.new
    @command_window = Window_Command.new(160, [s1])
    @command_window.index = @menu_index
    @command_window.y = 64
    Graphics.transition
    # Make status window
    @cprog_window = Window_C_Progress.new
    @cprog_window.x = 160
    @cprog_window.y = 64
    @ctprog_window = Window_Cap_Prog.new
    @ctprog_window.x = 0
    @ctprog_window.y = 0
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @cprog_window.dispose
    @ctprog_window.dispose
  end
  def update
    @spriteset.update
    @command_window.update
    @cprog_window.update
    @ctprog_window.update
    if @command_window.active
      update_command
      return
    end
  end
#--------update command---------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Capitol.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0 # Back
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_Capitol.new
        end
      return
    end
  end
end


#-------------------------------------------------------------------------------
# Capitol Build Shop Menu
#-------------------------------------------------------------------------------
class Scene_C_Shop
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Armor Shop"
    s2 = "Weapon Store"
    s3 = "Shield Seller"
    s4 = "Back"
    @spriteset = Spriteset_Map.new
    @command_window = Window_Command.new(200, [s1, s2, s3, s4])
    @command_window.index = @menu_index
    @command_window.y = 64
    Graphics.transition
    @status_window = Window_Cap_Shop.new
    @status_window.x = 0
    @status_window.y = 0
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @status_window.dispose
  end
  def update
    @spriteset.update
    @command_window.update
    @status_window.update
    if @command_window.active
      update_command
      return
    end
  end
#--------update command---------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_C_Build.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0 # Armor Shop
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Armor.new
        when 1 # Weapon Store
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Weapon.new
        when 2 # Shield Seller
          $game_system.se_play($data_system.decision_se)
          $scene = Scene_C_Shield.new
        when 3 # Back
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_C_Build.new
        end
      return
    end
  end
end


#-------------------------------------------------------------------------------
# Capitol Armor Shop Menu
#-------------------------------------------------------------------------------
class Scene_C_Armor
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Build"
    s2 = "Back"
    @spriteset = Spriteset_Map.new
    @command_window = Window_Command.new(200, [s1, s2])
    @command_window.index = @menu_index
    @command_window.y = 64
    Graphics.transition
    @status_window = Window_Cap_Armor.new
    @status_window.x = 0
    @status_window.y = 0
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @command_window.dispose
    @status_window.dispose
  end
  def update
    @spriteset.update
    @command_window.update
    @status_window.update
    if @command_window.active
      update_command
      return
    end
  end
#--------update command---------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_C_Build.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
        when 0 # Armor Shop
     
        when 1 # Weapon Store
     
        when 2 # Shield Seller
     
        when 3 # Back
          $game_system.se_play($data_system.cancel_se)
          $scene = Scene_C_Shop.new
        end
      return
    end
  end
end
Always remember you're unique.
Just like everybody else.

**
Rep:
Level 83
All that you know is at an end...
Thank you very much. The help is appreciated.

*
Rep:
Level 87
Always remember you're unique.
Just like everybody else.