NoMethodError, help on fixing it - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Code Support (https://www.save-point.org/forum-20.html) +--- Thread: NoMethodError, help on fixing it (/thread-3623.html) |
NoMethodError, help on fixing it - gRaViJa - 07-11-2011 I have a script that mimics psn/xbl Achievements. When trying to implement it to my game, i get a NoMethodError: The method that causes this error is the part that will show an alert when the player gets a new achievement. (Here's that part of the code that produces the error, exact line of error: if $game_system.queue.size > 0 && @frame < 1) Code: #=============================================================================== If i understand it right, this adds a method to module graphics to let it draw achievements. I have other scripts that possibly make edits to Graphics Module as well, so i think that causes the error? If so, is it possible to edit this script to fix the error without changing other scripts? Because then a tidal wave of other errors might occure. Full script here: http://www.text-upload.com/read.php?id=102621&c=7454606 Help is appreciated! RE: NoMethodError, help on fixing it - deValdr - 07-11-2011 try putting this at the beginning of the script: Code: #=============================================================================== Might fix it RE: NoMethodError, help on fixing it - gRaViJa - 07-11-2011 Hmm, didn't fix it. But I got a golden tip: it's because my splashscreen script calls the graphics module before this script. With this info I think i can solve this myself. RE: NoMethodError, help on fixing it - Victor Sant - 07-14-2011 @gRaViJa $game_system is initialized only after the new game/load game. so you can simply check if it's different from nil. if $game_system != nil and $game_system.queue.size > 0 and @frame < 1 |