I just want to ask if there is a code that allows us to detect the current existing data in a folder. For example, in my img folder I have a folder named samplefolder. Inside the samplefolder folder, I have three files, 'blockA.png', 'blockB.png' and 'blockC.png'. Now, I want to check if those three exist on that folder. I am just wondering if there is a javascript code that would let me kinda check if the folder samplefolder exists and those three images exist.
Thank you in advance.
With "normal" JavaScript, that's not possible. You can use the 'fs' module in Node.js (local game), though.
/edit: To clarify: It's possible to detect specific files via Ajax, but you can't just get a list of ALL files in a folder without Node.js.
Is that supported by ES5 / RPG Maker MV in general? I would like to know how to do this in Node.js. I would like to see an example and see what are the limitation it brings. If it is not possible, would there be an alternative that checks if a file is existent inside the game folder, so I can alert the user that such image does not exist.
You can set up a web server for your game (which you should probably do anyway if you ever deploy it); from here, you can pretty much do anything for your game that you can do on a normal web site, since you are serving up content.
If the purpose of this is just to satisfy your laziness, however, you're better off trying to compile everything into a single Javascript file. You can do this pretty easily using a ruby script, for example, or you can look to more sophisticated build libraries.
Ohhh this became harder than I thought. I will use Zale's plugin for this. It seems it is a better solution that the one I thought of. I thought there was a manual way for this or a simpler way only for PC developed games (those that are not to be shared online, webserver or an html5 game).