Loading problems...
Hi, can anyone tell me what kind of error it is and if so how i could solve it?
the game i'm developing, from a certain point on, has a hard time loading the saves, or they remain on black screen or this error appears. i've tried to lighten the quality of the images, to make the code lighter, to see if some sounds were giving the problem, but nothing worked. i'm wondering if it's not a problem of some loading script or similar, because i really don't know where to beat around the bush anymore...
It's hard to tell as I'm not using VNM
However, _this is not defined means you are trying to access something that hasn't loaded yet or isn't available, hence the "undefined".
The error seem to point at index.html at line 2 column 11
Care to share what's at that location?
_this is usually used inside functions to maintain original context, so it could be it hasn't been correctly initialised. (Aka, declaring a variable after calling the function that uses that variable)
If it is used in a function, and it has been correctly initiated, try binding it using .bind(this)
Simply add var _this = this; in your function
Maybe share the code you are using that is generating this error?
Overall, it could be the script loads faster than the game state, triggering undefined errors as it tries to call for objects that aren't ready to use.
I think it's between these lines that the problem lies, but I'm not sure, I admit I'm not very familiar with codes and scripts in general ^^", I'll also attach what I "think" is the script that gives problems ^^"
I imagine that it is like RPG maker, i.e. you programme everything without writing codes, but it still has scripts in it, (forgive me if I'm talking nonsense, but as you may have guessed, I'm not very experienced in programming with codes XD)
however this is the MAIN code of the game, I BELIEVE the loading system is here...?
This looks like something I can work with indeed ^^
I changed the script to try and catch any potential error.
Make a backup of your original file, and try this new one instead, launch the game and see if the error message has changed.
If the error is dued to loading, this new file should be more precise about what part causes the issue.
And don't worry about not being comfortable with scripting, that's the reason VNM and RPG Maker exist ^^
To make it easier for non-scripters to create. 🙂
I tried replacing the original code with the new one, now the game remains fixed on a black screen as soon as it is opened.
I tried replacing the original code with the new one, now the game remains fixed on a black screen as soon as it is opened.
on the other hand, no errors are reported XD
Here is a newer version with stops logs to see what is loaded, where it stops and if any error occurs.
The black screen could potentially mean certain files are corrupted or not present.
Did you press F12 and look at the console?
Anyway, try this new file, run the game a few times, and share the logs (F12) for detailed debugging. 🙂
If it's a black screen, try a few more times to see if you can trigger an error.
We'll get this fixed 😀
It can be a variety of things, the console log (F12) is needed to debug this as I set a bunch of detailed markers in it, to see what and where it happens.
Gradually slowing down is typical of memory leaks, or ressource managment.
Keep an eye on CPU and RAM during playtests to see if those skyrocket.
Without the logs, I can't do much more than guessing though.
don't worry, in fact thank you very much for your help! you've been very kind! \^.^/
some of my beta testers, are trying to see if it could be the 'skip' command that could cause certain problems, perhaps sending scenes forward too fast could prevent certain variables or resources from loading correctly...
I suspect either loading issues or memory leaks.
The file I sent is full of checkpoints to see where exactly its blocks, what part is having troubles.
You seem like you don't want to share the logs, so I can only wish you good luck 🙂
I haven't the faintest idea what certain errors indicate (not to mention that when pressing f12, there is no command to log ^^")
the only thing I could do is check CPU and memory with the task manager, but there were no spikes, everything remained very constant
This is strange, not a single mention of my checkpoints...
Did you replace your main.coffee file with the one I gave? (It's 100% the same thing, it just add console messages for debugging)
If you are playing in a browser, clear the cache and refresh the page to ensure using the new main.coffee file.
Since you are talking about beta testers, could you share a copy after trying the above ?
I'm sorry to say I'm at a loss here, it's like the game didn't even get passed the main constructor initiation.
Yes, in DM is fine 🙂
Hopefully someone with more VNM knowledge will be able to help though.