@lavra: I could, but I feel like that would be even messier. I am looking at some alternatives to the current structure, but I feel like preloading specific files on boot is sufficiently advanced enough to warrant a somewhat less user-friendly approach.
@blubberblubb: You're right, that's actually an oversight. I'm adding it to the list of stuff I'm working on for this now. Hopefully I can have these changes implemented very soon 🙂
Thank you so much for the update! It'll prove extremely helpful once I can get the bug problem solved.
Regarding that, my apologies, I was completely misdirected.
The issue is with this line:
if(!DataManager.isDatabaseLoaded()) return setTimeout(this._performPreload.bind(this), 5);line 435 from PreloadManager
It causes the following "snowball effect":
Uncaught TypeError: Cannot read property 'note' of nullrpg_managers.js:1606 file:///E:/Aaron/RPG%20Maker/OH!%20RPG!/js/plugins/YEP_CoreEngine.js 547/E:/Aaron/RPG%20Maker/OH!%20RPG!/js/plugins/YEP_CoreEngine.js:547 Uncaught TypeError: Cannot read property 'note' of nullYEP_CoreEngine line 547 is this:
DataManager.processCORENotetags1 = function(group) { for (var n = 1; n < group.length; n++) { var obj = group[n]; var notedata = obj.note.split(/[\r\n]+/); obj.maxItem = Yanfly.Param.MaxItem;"var notedata = obj.note.split(/[\r\n]+/);"
If I comment out your line of code then it works, but I'm sure that's not the right way to "fix" it.
DataManager.isDatabaseLoaded calls DataManager.processCORENotetags1 which produces the error.
Yanfly.Core.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;DataManager.isDatabaseLoaded = function() { if (!Yanfly.Core.DataManager_isDatabaseLoaded.call(this)) return false; this.processCORENotetags1($dataItems); this.processCORENotetags1($dataWeapons); this.processCORENotetags1($dataArmors); this.processCORENotetags2($dataEnemies); this.processCORENotetags3($dataActors); this.processCORENotetags4($dataClasses); return true;};Not really sure why, though...
Edit: I can "fix" it by adding a catch:
DataManager.processCORENotetags1 = function(group) { for (var n = 1; n < group.length; n++) { var obj = group[n]; if (obj == null) { return; } var notedata = obj.note.split(/[\r\n]+/); obj.maxItem = Yanfly.Param.MaxItem;But I figured you might know more before I start messing with Yanfly's script and yours. xD
@ArkDG I think that'd get really messy to keep track off honestly. But an option you have is to use the advanced configuration for preloading files on startup, then preload the important ones then, and disable automatic map preloading. Still, I'll see if there's any feasible way to do something like this.
Do you want me to upload a tiny size version of an empty project with the 2 scripts so you can check it out?
Whenever you reply but ignore my post it kinda throws me off. Not sure if I should wait until you post another reply or if you just skipped it. x)
@Cinnamon: Usually when I reply to something else first it's because I need more time for the other question(s), as in this case. But I may also have overlooked it, so don't worry about poking me again on it, or PM'ing me as a reminder 🙂
I've been looking into it a bit and I'm searching for the best approach. Personally I feel like it's not a good idea to put the notetag parsing logic in the isDatabaseLoaded() function as is the case in YEP_CoreEngine, because this function shouldn't do data alteration. It's used to check whether all database items are loaded and should be safe to call continuously, but with the notetag parsing in place it seems to me it repeats said parsing every time you call it and the database is loaded.
I haven't been able to reproduce the error you're getting on my end, so if you could send a tiny project file over it'd be helpful. I see what the problem is, but it puzzles me why it's happening since the notetags shouldn't be read when the database is not fully loaded. Most likely I'll have to call it a bug in YEP_CoreEngine, but I'll take a closer look at your project file first 🙂
Hey guys!
Sorry for my absence, I thought I "fixed" it by placing this at the top of each of Yanfly's notetag functions:
if (obj == null) { // checks for the error OH RPG PreloadManager return; }BUT then my weapons, items and armor started changing. For example, weapon ID 7 would become weapon ID 2 (nooooo idea why). This only happens 66% of the time! The Yanfly x Preload bug doesn't ALWAYS happen, for whatever reason.
I don't think this is a bug with either script specifically, more an incompatibility error? Either way I really hope one of you can help out. Let me cut down the project as much as I can and send it over. Give me 30-60 mins.
Edit: Sent!
Just a tiny poke, if PreloadManager was also preloading the BGM from battle trigger events in a map, any sort of delay for all usual BGM situations would be gone (if combined with the WebAudioCache). So as soon as you add this detail, there will no longer be a need to tell people "the sound delays are fixed with those plugins ... except for battle music".
Also I would recommend always preloading the title music piece in the initial loading screen (even when "Preload System Music" is set to false and the other BGM pieces set in the "System" tab wouldn't be loaded). Multiple of my testers thought there was no music on the title menu of my demo game and skipped ahead because of the usual delay of non-preloaded music starting, so I see no good reason not to have it ready once the title screen shows. People are usually quick to skip past the title if there isn't anything exciting going on, so the music should definitely play instantly to draw them in with some awe and amazingness to have them admire the title screen for a few more moments before they hurry into the game.
I am having an issue where the loading screen is infinite on mobile devices with my game. I made sure all the resources are there. Also when disabling the preload the system music it seems to finally run. However right when the game starts I get unable to load image face/person1.png. I have the file in the location and I have no issue on the pc version. I tried to remedy this by going into the advance config and adding in that file specifically but now the loading time is back to infinite. Disabling the script resolves the issue. I can try and get whatever debug information is needed however there is 0 issues on loading the game on windows 10 with the console enabled.
I have the same infinite loading screen as above on PC. But it only seems to happen about 5-10% of the time. Other times the maps load fine.
However it's still often enough that I cannot use the plugin as over the course of playing the game for an hour you're guaranteed to eventually get a hang.
I'll take a look at these bugs. I think what @clitvin is experiencing on PC is the fact that occasionally the webkit wrapper just fails to load a resource, and I haven't made a failsafe for this yet because I was sort of hoping it would be solved by official patches sooner rather than later. Since it hasn't, I'll have to figure out a way to deal with this more cleverly. So in other words I'm aware of it 🙂
When it comes to mobile devices, I really have no clue what might be the problem there. Is it possible to get access to the debug console on mobile when testing the game to see if it spits out any error messages of relevance?
EDIT: Ok as it turned out, my previous gripe was with MV itself, which just isn't playing my ME sound during local testing, works fine on live.
Does this plugin have any effect on Animations? I'm using the Show Animation command during an Event on a particular map, and the first time it plays, it stalls for a second, but every other time after that it runs smoothly. It would be nice if I could somehow force the Animation to preload along with everything else.