how do i fix this error?

1679652913370.png

i've been trying for a while to figure out why this error keep appearing even though it was fine yesterday for me

the screenshot below is what came out when i followed some random help
1679652783836.png
You should never change the default scripts.

Line 53 is "else"

put the original code back and see what happens.
It looks like you deleted one line.

and sprite picture only has 83 lines, so you are using a custom script. What is that script?
In contrast, I commonly encourage to edit and extend default code. But this only applies to people who know what they're doing and can help themselves if a change blows up. Some may ask why, it's because stacking additional code into the same functions through ALIAS can't go well forever, and will make you loose any overview on what the function is doing. But back to the main issue here.

If you can't solve this by reversing all changes done to "Sprite_Picture", please post a full copy of it so we know what to work with. The two errors shown don't contain any good useful information besides "Some referenced object that could be literally anything does not exist.", so context is necessary.

~炬燵あ
You should never change the default scripts.

Line 53 is "else"

put the original code back and see what happens.
It looks like you deleted one line.

and sprite picture only has 83 lines, so you are using a custom script. What is that script?
oh i tried to look up a guide and i just followed with it and just think "oh yeah this would work", i also tried reverting it back to normal and somehow it still gave me the same issue
1679665683489.png
Never ever define anything for NilClass. What the hell am I looking at?

~炬燵あ
What "guide" are you talking about? What is the script?

If you get the error, then hit F11 in the editor, it'll take you to the line that threw the error. Post a picture of that (with the line numbers not cut off like you've done above).

Moved to: RGSSx Script Support
well i went on a digging spree on google and went to the second page of google and found this. https://rpgmaker.net/forums/topics/20002/
so i thought to attach it right onto Sprite_Picture

but i think i should put the project files onto here so it's less confusing
so i thought to attach it right onto Sprite_Picture
I assume you didn't try to understand the comment in that post of what that script does, right?

Because it is intended to stop the error messages, NOT to solve the problem.


To give you a better description and to help you understanding that answer, it's comparable to this:

"Hey, in my car the oil warning lamp has gone red, what should I do about it?"
"Easy, just put black tape over the lamp and you can continue driving without being bothered by that red lamp."

Of course that only works until your car breaks down due to bad oil and you have to replace the engine. I think it would have been cheaper to simply change the oil when the lamp turned red...


Take this as a warning: never use a script if you don't understand its purpose.
i decided to throw away
"if @picture.name.empty?
self.bitmap = nil
else"
after a while of staring at the common event i uses that causes the issue it turn out the picture i was using was empty so after a while more of staring at Scene_Picture i just decide to throw away the part that make it (i think) name itself as nil when picture is empty. and it fixed it (but i have no ideas if it's illegal or unorthodox) ! but i did ended up learning a lots more from this thread
The error is a symptom of a problem. Stopping the error is not making the problem go away - the problem will still be there, but it just won't tell you about it.

This is not a good thing. That script is a bad idea.
Can you undo changes to either the first error, or prior to it? What was the initial issue you wanted to try and solve?

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-fix-this-error.156097/