Show picture (sequence) causing problems

I get the following error:  Uncaught TypeError: Cannot read property 'width' of null

It happens when I have the player transfer to a map with a cut scene. It's an autorun event that does the following:

Show picture 1
wait 8 frames
Erase picture 1
Show picture 2
wait 8 frames
Erase picture 2

etc etc... about 26 times.  It creates a nice little animation.  The error doesn't happen every time, that's what's frustrating. Some test plays I can get through it, then I try again later and I get the error. What do you make of this?  Oh yeah, in browser test, it just says "Script Error".
Please give screenshots of the event pages, we can't look for a bug from incomplete descriptions alone.


That said, if it doesn't happen everytime then most likely it's caused by a mixture of several parallel processes and/or autoruns being active at the same time.


Please check the link to "Bughunting" in my signature to learn more about timing errors and how to solve them.
Edit Topic Cleanup:

I'll mark this topic as solved. I can confirm that the wait times had something to do with it and changing them ever so slightly has killed the error.

At first, Tested from start new game directly to the map with the autorun event. Error occurred every single time. Not randomly. Changed the first "wait 8 frames" to "wait 9 frames" and left all the others alone, the error no longer occurred.

Next, tested from the very beginning of the game and played up till this point. The error occurred. I proceeded to "trim" some of the wait times in all the various events throughout the game, fine tuned it... the error is gone.

image.png


image.png
You don't need to show one picture then erase it, then show another picture then erase it.


Just use the same picture id each time, and get rid of the erase commands, except the last one.


Show Picture 1 1-d1


Show Picture 1 1-d2


Show Picture 1 1-d3


Show Picture 1 1-d4


Erase Picture 1


You could also ditch pictures and USE an animation, if the images are the correct size to create an animation sheet.

Original thread: https://forums.rpgmakerweb.com/threads/show-picture-sequence-causing-problems.51958/