[SOLVED] Undefined Method "opacity="

Status
Not open for further replies.
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
So I've been working on a conversion merger of two scripts I found doing similar things and rewrote the two into my own one so it'd do exactly what I want. After finishing the script I proceeded through bug testing and have fixed numerous bugs already (mostly spelling mistakes or formatting errors like capitals in wrong places) but I came across the all too famous Undefined Method error. Usually with some working I just simply find my way around it but this time I have unfortunately not succeeded so I thought I'd bring it to the community to ask if anyone else was familiar with and would be able to assist me in finding my way around this so I can continue with the rest of my bug testing.

The snippet of code in question is:
 

  # Initialization  def initialize(x,y)    super(x,y, 165, window_height)    self.opacity = Settings::HWindowOpacity    refresh  end

The problem is, when I press new game, the game brings up a error stating:
 

Script 'Darrell Script' line 1111: NoMethodError occured.undefined method 'opacity=' for #<Window_HUD:0xa2dbe3c>I was wondering if anyone could spot browsing over the snippet something obvious that I have merely been overlooking that could resolve this or if someone could suggest a deeper routed problem that I could look into fixing. That would be great.

Thank you.
 
Last edited by a moderator:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
707
First Language
English
Primarily Uses
RMMV
Mm, probably going to need a bigger picture to help with the script issue, really. With over a thousand lines of code, the error could be cropping up anywhere. I imagine that the 'Window_HUD' is a 'Window' class, so 'opacity' should be there. You may want to make certain that 'Window_HUD' is including the 'Window' class (or 'Window_Base', 'Window_Selectable', etc)
 
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
I knew there was probably a really simple explanation I was overlooking. I always find having an outside eye who knows what to look for can really help. I'd simply in my haste left 'Window_Base' off and in the hue of doing way too much code, I was struggling to look at the bigger picture. Thank you so much for your help, I can go back to going down my bug list for this script now, hopefully I'll have it all working soon! :D

SOLVED - CLOSED!
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
707
First Language
English
Primarily Uses
RMMV
Oh! Well ... that was easier than I was imagining.
 
Joined
Sep 16, 2013
Messages
30
Reaction score
12
First Language
English
Primarily Uses
Yeah, apparently I have just spent too much time staring at code I'm not seeing things right in front of me. Though in fairness, I usually solve the complicated ones and then miss the obvious right in front of me all the time!  :guffaw:
 

Mithran

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
404
Reaction score
212
First Language
English
Primarily Uses
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts


The main character of the book)
Things you can say about your rpg maker project but not your bf/gf: I'm not super committed but it's fun to play around with it.
putting a puzzle in my game that BSODs the player's computer if they complete it
I finally got a book out the door after seven years of nothing \^-^/ Now if I can get a game out the door too, that'd be great...

Forum statistics

Threads
94,365
Messages
920,291
Members
124,130
Latest member
jarja2541
Top