- Joined
- Oct 11, 2015
- Messages
- 424
- Reaction score
- 171
- First Language
- Dutch
- Primarily Uses
- RMMV
I have an image here: <project dir>/img/minimap/005.png
Sadly this function always returns false.
Console output: /img/minimap/005.png
Code to load image:
Is this because I launch RPGMaker through Steam now? Does it change the executable path or something for the ImageManager? This used to work in the older version of RMMV when used with the standalone editor (=not Steam).
The code ImageManager.loadBitmap() always returns a BitMap, even if it does not exist on disk so I can't just do a null-check.
Code:
SE.TEST = SE.TEST || Utils.isOptionValid('test');
SE.Minimap.minimapFolderPath = function()
{
var suffixPath = '/img/minimap/';
if (!SE.TEST) { suffixPath = '/www' + suffixPath; }
var path = window.location.pathname.replace(/(\/www|)\/[^\/]*$/, suffixPath);
if (path.match(/^\/([A-Z]\:)/)) { path = path.slice(1); }
path = decodeURIComponent(path);
return path;
}
SE.Minimap.getFullMinimapPath = function(filename)
{
return SE.Minimap.minimapFolderPath() + filename;
}
// filename example: '002.png'
SE.Minimap.minimapImageExists = function(filename)
{
var fs = require('fs');
console.log(SE.Minimap.getFullMinimapPath(filename));
return fs.existsSync(SE.Minimap.getFullMinimapPath(filename)); // <<<<<< always returns false.
}
Console output: /img/minimap/005.png
Code to load image:
Code:
ImageManager.loadMinimap = function(filename, hue)
{
return this.loadBitmap('img/minimap/', filename, hue, false);
};
this.mapBmp = ImageManager.loadMinimap(this.mapName);
The code ImageManager.loadBitmap() always returns a BitMap, even if it does not exist on disk so I can't just do a null-check.

