Lemony's Default Map Tone problem when loading in battle.

I'm using the script specified in title and when I try to start a battle I get the next error window:

JrcSSLw.png


When I open the Script editor prompts me to the next:

mHOX6Cn.png


The script is part of Restaff February 2013, but I'll leave the script attached for reference.

Default Map Tone & In Game Map Screen Tone Changer.txt

Any help is highly appreciated I really like this script since is the only method I know to load screentones before the player reach the map.
I'm taking a quick guess as I don't have RM with me at the moment, but replace that line to this.

I'm pretty sure that's what's causing the issue as scene_battle doesn't have that def in it.

Code:
if SceneManager.scene_is?(Scene_Map) ; return if SceneManager.scene.ldmt_set ; end
I'm assuming that variable needs to be set before you can move by input.

Code:
return if SceneManager.scene.is_a?(Scene_Map) && SceneManager.scene.ldmt_set
I'm also assuming the problem occurs when you're pressing the direction keys during battle?
I'm assuming that variable needs to be set before you can move by input.

return if SceneManager.scene.is_a?(Scene_Map) && SceneManager.scene.ldmt_setI'm also assuming the problem occurs when you're pressing the direction keys during battle?
Ah that's better, I'm busy at work so that's why I wrote it the way I did. Thanks for fixing for me though Tsukihime. You'll want to use her way.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
I'm assuming that variable needs to be set before you can move by input.

return if SceneManager.scene.is_a?(Scene_Map) && SceneManager.scene.ldmt_setI'm also assuming the problem occurs when you're pressing the direction keys during battle?
no, happens when I transition from map to battle, like moving around searching for random encounter to happen, then it crashes.

Should I modify line 190 to that one?

Original thread: https://forums.rpgmakerweb.com/threads/lemonys-default-map-tone-problem-when-loading-in-battle.36512/