MZ A question about folders.

Hello again! I've noticed that the editor detects the folders of your games, including their respective contents and you can select the graphics in them. But for some reason the game doesn't do it, so I was wondering if there is a way to have it working. I think it could help a lot to have a clean workspace organized in folders, especially for the pictures, huds and stuff.
I'm assuming what you'd like to do is to split your graphics across multiple folders for organisation?
Unfortunately it's not possible to modify the editor itself, so there's do way to do it and have the editor recognise it.
The second best thing is loading the images with scripts instead of the built-in event, then you can organise them however you want.
@Mac15001900 but as said the editor already detects the folders, no need to modify it.

@Kaszdev what version of the core files is your project?
If I remember correctly that feature (folder use) was added later, which means that the game engine itself needs to be updated to the same version as the editor before it can handle them
@Mac15001900 but as said the editor already detects the folders, no need to modify it.

@Kaszdev what version of the core files is your project?
If I remember correctly that feature (folder use) was added later, which means that the game engine itself needs to be updated to the same version as the editor before it can handle them
It's 1.5.0, it seems strange that the editor has access to the folders and their graphics but the game gives an error when selecting them.
what exactly is that error? does it happen in playtest or in deployment? The cause might be something entirely different...
what exactly is that error? does it happen in playtest or in deployment? The cause might be something entirely different...
1665409016293.png

While testing. The graphic "Bush.png" is inside the folder objects
Edit: A plugin to remove blur seems to be causing this error
@Andar Ah, I didn't notice this is MZ, my bad xD

@Kaszdev It seems to be trying to load "objects%2FBush.png", instead of of "objects/Bush.png", so somewhere along the line something must have messed with the string's encoding. Might be fixable if you're willing to dig through the code and find where the / -> %2F change happens.
can you press F8 on that error message and give a screenshot of the console? (console, not elements)
that will tell us what tries to load the picture

EDIT:
didn't see your edit. and I think I know where that plugin has messed up, the difference between string and filepath is that a filepath inside a string needs a double \\ instead of a single one.

can you give a link to the plugin to check its code?
can you press F8 on that error message and give a screenshot of the console? (console, not elements)
that will tell us what tries to load the picture

EDIT:
didn't see your edit. and I think I know where that plugin has messed up, the difference between string and filepath is that a filepath inside a string needs a double \\ instead of a single one.

can you give a link to the plugin to check its code?
There's it. It's supposed to remove the blur from the sprites when the window is resized.
JavaScript:
ImageManager.loadBitmap = function(folder, filename, hue, smooth) {
    if (filename) {
        var path = folder + encodeURIComponent(filename) + '.png';
        var bitmap = this.loadNormalBitmap(path, hue || 0);
        //console.log("disabling smoothing for "+path);   
        bitmap.smooth = false; return bitmap;
    } else {
        return this.loadEmptyBitmap();
    }
};
And there you have it, exactly as I guessed.
Only the filename gets encoded, the folderpath not.
that doesn't matter for single folders, but if it is a path of multiple foldernames the automatic conversion to string and back will cause problems with the slashes.

unfortunately I don't know enough of the engine to know how to include the folder variable into the encoding, so I'll have to leave that here for someone who can edit that code correctly.
And there you have it, exactly as I guessed.
Only the filename gets encoded, the folderpath not.
that doesn't matter for single folders, but if it is a path of multiple foldernames the automatic conversion to string and back will cause problems with the slashes.

unfortunately I don't know enough of the engine to know how to include the folder variable into the encoding, so I'll have to leave that here for someone who can edit that code correctly.
You just need to concatenate the folder and filename together before passing the string to encodeURIComponent.
I.e.
JavaScript:
var path = encodeURIComponent(folder + filename) + '.png';

Original thread: https://forums.rpgmakerweb.com/threads/a-question-about-folders.151895/