Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: G_G on May 31, 2009, 11:43:40 am

Title: Quest Script
Post by: G_G on May 31, 2009, 11:43:40 am
Okay this window is being stupid. The window is setup correctly I'm sure yet it says undefined method .clear or something heres my window

Spoiler: ShowHide
class Window_QuestInfo < Window_Base
  def initialize(name, info, location, reward, completed)
    super(300, 64, 340, 416)
    @name = name
    @info = info
    self.z = 200
    @location = location
    @reward = reward
    @completed = completed
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 300, 32, "Quest")
    self.contents.draw_text(4, 64, 300, 32, "Description")
    self.contents.draw_text(4, 160, 300, 32, "Location")
    self.contents.draw_text(4, 256, 300, 32, "Reward")
    self.contents.draw_text(4, 320, 300, 32, "Completed")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 300, 32, @name)
    self.contents.draw_text(4, 96, 300, 32, @info)
    self.contents.draw_text(4, 192, 300, 32, @location)
    self.contents.draw_text(4, 288, 300, 32, @reward)
    self.contents.draw_text(4, 352, 300, 32, @completed)
  end
end


Someone help here's the error I get

Spoiler: ShowHide
(http://i307.photobucket.com/albums/nn318/bahumat27/errorr.png)
Title: Re: Quest Script
Post by: Aqua on May 31, 2009, 11:52:04 am
.clear is a Sprite feature, not a Window one.

I don't know the Window equivalent... @.@
Title: Re: Quest Script
Post by: G_G on May 31, 2009, 12:17:21 pm
I removed that line and apparently it gets an error with
self.contents.font.color = system_color

It says the same error just replaces clear with font and I know that cant be right
Title: Re: Quest Script
Post by: Blizzard on May 31, 2009, 03:49:02 pm
You never created the bitmap. There's no line in def initialize saying:

self.contents = Bitmap.new(width - 32, height - 32)
Title: Re: Quest Script
Post by: G_G on May 31, 2009, 04:38:54 pm
OMG I AM RETARDED!!! Thats one of the things I have to remember in windows and I forgot!! Thanks blizzard!
Title: Re: Quest Script
Post by: Blizzard on May 31, 2009, 05:29:40 pm
It still sometimes happens to me as well. xD