Below is what I believe to be the problem. web and mobile do not have access to node functions. Does anyone know how I can get the images without using fs? I asked GPT and it said I can create a .json with all the image names and then do a get fetch request but that seems odd to me. Any thoughts?
JavaScript:
this.crossEngine={};
var fs = require ("fs");
//yanfly's doodads have a solution for path name changing when deployed
//which I am using!
var path = require('path');
var base = path.dirname(process.mainModule.filename);
//let dir = fs.readdirSync( './img/characters/' );
let dir = fs.readdirSync( path.join(base, '/img/characters/'));
this.crossEngine.characterNameList = dir.filter( elm => elm.match(new RegExp(`.*\.(png)`, 'ig')));
this.crossEngine.characterNameListLC=['hello world'];//this should never appear in game.
//slice off the .png extension
for (var index =0; index<this.crossEngine.characterNameList.length;index++)
{
this.crossEngine.characterNameList[index]=this.crossEngine.characterNameList[index].slice(0, -4);
//create a lower case version of it so that we can do case matching for poses
this.crossEngine.characterNameListLC[index]=this.crossEngine.characterNameList[index].toLowerCase();
}