Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Syntax Error

Hello. I am following Dubealex' rgss tutorial and as I try it out, it resulted to an error.

class My_Window < Window_Base

  def initialize
    super(0, 0, 200, 200)
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial" 
    self.contents.font.size = 24
    self.contents.draw_text(0, 0, 200, 32, "Yay, some text !")
  end
 
end
An event calls a new instance for this class

The error was(as soon as the game was started):

Script 'TEST' Line 1: TypError occurred.

undefined superclass 'Window_Base'


I was sure I hadn't messed with the default scripts.
 

poccil

Sponsor

That happened because you placed the script section before the script section "Window_Base" was defined (likely as the first in the script editor).  Try placing the script section after "Window_Base".
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top