MZ ImageManager.loadBitmap not finding specified file.

Hey, it’s me again, I am attempting to load a bitmap based on a custom directory in the Img folder: img/excavating/

The code is as follows:

Code:
var Excavating = Excavating || {};
Excavating.XS = Excavating.XS || {};
Excavating.XS.version = 1.00;

Excavating.Parameters = PluginManager.parameters(‘Excavating Core Plugin’);
Excavating.Param = Excavating.Param || {};

Excavating.Param.excavatingBackground = Excavating.Parameters[‘Background Directory’] || ‘’;

Spriteset_Excavating.prototype.createExcavatingBackground = function(){
  this._excavatingBack = new TilingSprite();
  this._excavatingBack.bitmap = ImageManager.loadExcavatingBG(“excavateBackground”);
  this._backgroundSprite.addChild(this._excavatingBack);
};

ImageManager.loadExcavatingBG = function(filename){
 return this.loadBitmap(Excavating.Param.excavatingBackground, filename);
};

Unfortunately, when I use this code, it fails to find the file regardless of location, how many times I redo the directory, or how many times I recreate the file it is supposed to locate.

Is this coding outdated in the case of RPG Maker MZ version 1.5.0? Please let me know what I’m doing wrong.

It is saying that the file failed to load: excavateBackground.png.
Hi there!

It should work. Can you try a console.log like this to check for the names:

JavaScript:
ImageManager.loadExcavatingBG = function(filename){
    console.log(Excavating.Param.excavatingBackground, filename)
     return this.loadBitmap(Excavating.Param.excavatingBackground, filename);
};

Also, are you sure that the file and folder names are the same, even matching the lower/upper case letters?
It looks to me like you're using the wrong characters for quotes. The single quotes you're using are ‘ and ’ but it should be ' and '. The double quotes are also wrong. You're using “ and ” but it should be " and "

On my system the quotes you're using cause an error. But if that's not the case on your system, then do as Eliaquim says and use console.log to try to figure out what value is being used, and then we can go from there.

Original thread: https://forums.rpgmakerweb.com/threads/imagemanager-loadbitmap-not-finding-specified-file.148449/