Events based on files?

Heya! I was wondering if it was possible to base events on files. For example, if you put a specific-named file inside the game’s project folder, could you use that as a sort of trigger for an event? (For example: if “FileA” is present, then blank) Thanks!
Sure, it can be done with a script command:
JavaScript:
let fs = require('fs');
$gameSwitches.setValue(42,  fs.existsSync("example.png"));
This will turn on switch 42 if a file called example.png is present in the game's folder. You can then use that switch as a condition for an event or whatever you need.

Of course this will not work in a browser version.
Oh, that’s exactly what I needed! Thank you very much!
Sure, it can be done with a script command:
JavaScript:
let fs = require('fs');
$gameSwitches.setValue(42,  fs.existsSync("example.png"));
This will turn on switch 42 if a file called example.png is present in the game's folder. You can then use that switch as a condition for an event or whatever you need.

Of course this will not work in a browser version.

Original thread: https://forums.rpgmakerweb.com/threads/events-based-on-files.169694/