Show picture (sequence) causing problems

ScroogeMcDuck

Villager
Member
Joined
Oct 28, 2015
Messages
15
Reaction score
1
First Language
English
Primarily Uses
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".
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
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.
 

ScroogeMcDuck

Villager
Member
Joined
Oct 28, 2015
Messages
15
Reaction score
1
First Language
English
Primarily Uses
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.



 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,714
First Language
English
Primarily Uses
RMMV
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.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top