MV Weird intermittent crash bug

I've had this weird crash bug with my game, but it's only appeared twice, once yesterday, once today.

The crash looks like this:

1615473225432.png


It happened instantly, when I hit "play" in the editor. However, if I close the game, then hit "play" again, it runs perfectly fine.

That's why I ignored it the first time; I figured it was just one of those "cosmic ray" errors; however it happened a second time today - again, it went away when I closed the game and hit play in the editor a second time.

Should I take from that console output that the problem is in Mano_InputConfig.js?
Yes, the error appears to be that $dataSystem is null (awaiting data from file) when Mano_InputConfig tries to check the game's locale.

The error timing seems odd, though. As far as I can tell, the locale check only occurs when the game saves the options and there is no custom button map already defined. By default the options are only saved (ConfigManager.save()) when exiting the options scene.

I guess that another plugin you're using is trying to save the config on game launch, before the database has had a chance to load. This causes an error in Mano_InputConfig because it expects the database to be loaded by that point.

Possible workaround: edit your copy of Mano_InputConfig so that the locale is fixed, e.g. (untested) replace this part of the plugin's code:
JavaScript:
function defaultKeyLayout() {
    if($dataSystem.locale ==="ja-JP"){
        return 'JIS';
    }
    return 'US';
}
...with something like this:
JavaScript:
function defaultKeyLayout() { return 'US'; }
Thanks a bunch, Caethyril! I tried that change and haven't seen a re-occurrence of the issue yet.

Original thread: https://forums.rpgmakerweb.com/threads/weird-intermittent-crash-bug.134310/