Hi,
I've heavily modified/rewritten most of the scripts in the game, lately while running a snippet of code out of the event editors script window I recieve the error
"No Method Error "<=>" for Nilclass"
The line the error is for is inside of the Interperter Class, it is the result=eval(script) line at the end of the
class.
I have tried rewriting my code a hundred different ways,
and to no avail.
Most oddly, when I if I add "p eval(script)" right above this line, or in place of this line,
It shows that eval is returning true.
Also, I've tried adding "p 5" after every line of code called by anything involving the snippet causing the error,
and every single line executes just fine.
Event stranger, code after the script command executes, which confuses me as to why the error
would pop on a line that was called a several commands prior...
The code in the script command window is
[rgss]$scene.fog_z(0)
$game_map.flux_setup
$game_map.pix_names
[/rgss]
The first line is not the problem and just does some stuff with the spriteset in Scene_Map.
The flux_setup and pix_names commands just set values for some data in Game_Map,
all of which is initialized with the initialize method; they, literally, do nothing else.
Thank you for any help/suggestion, I've been puling my hair out for the last several hours over this,
I even read through the entire C source code of the eval method, just to see what I might be missing...
Nothing.
*PS I'm 100% positive that even though the modification I've made are extensive, they shouldn't have had any real impact on this; most of it was overhauling the battle system and title scene; I've just started with
maps. (I'm betting the problem is something extremely simple...hoping, at least.)
**Can't believe I forgot to mention this, these commands seemed to work fine a few days prior;
The only thing I've changed is adding an "and @delay != -1" at the end of an unless inside of
Game_Picture, which shouldn't be relevant, and cleaned up a few other things; again that shouldn't be relevant.
***This is actualy starting to get interesting; Ruby is my favorite language and I can't even begin to think what could be happening now. I made a new event whose only command was to run the script
[rgss]
$game_map.flux_setup
$game_map.pix_names
[/rgss]
Now, if I comment out either of the lines, everything works fine. However, if I combine both methods into a single method, then everything fails all over again; which is where I'm getting confused, since there is no good reasonf or this behaviour. Here is each method:
[rgss]def pix_names(arr = ["1", "2", "3", "4", "5", "6", "7"])
@images = arr.dup()
return true
end
def flux_setup
@flux = [[[-50, 50],[-75, 35],[-125, 35]],[28,48], "Circle", "Stars"]
return true
end
[/rgss]
As said, putting
[rgss]def names_plus_flux(arr = ["1", "2", "3", "4", "5", "6", "7"])
@images = arr.dup()
@flux = [[[-50, 50],[-75, 35],[-125, 35]],[28,48], "Circle", "Stars"]
return true
end
[/rgss]
Also, calling the flux_setup command with @flux as an attr_accessor causes the same error, even if it is by itself;
but remove the accessor, and it works.
****I haven't touched anything in the interperter except the commands used to display the message window, and they aren't causing the problem.
I've heavily modified/rewritten most of the scripts in the game, lately while running a snippet of code out of the event editors script window I recieve the error
"No Method Error "<=>" for Nilclass"
The line the error is for is inside of the Interperter Class, it is the result=eval(script) line at the end of the
class.
I have tried rewriting my code a hundred different ways,
and to no avail.
Most oddly, when I if I add "p eval(script)" right above this line, or in place of this line,
It shows that eval is returning true.
Also, I've tried adding "p 5" after every line of code called by anything involving the snippet causing the error,
and every single line executes just fine.
Event stranger, code after the script command executes, which confuses me as to why the error
would pop on a line that was called a several commands prior...
The code in the script command window is
[rgss]$scene.fog_z(0)
$game_map.flux_setup
$game_map.pix_names
[/rgss]
The first line is not the problem and just does some stuff with the spriteset in Scene_Map.
The flux_setup and pix_names commands just set values for some data in Game_Map,
all of which is initialized with the initialize method; they, literally, do nothing else.
Thank you for any help/suggestion, I've been puling my hair out for the last several hours over this,
I even read through the entire C source code of the eval method, just to see what I might be missing...
Nothing.
*PS I'm 100% positive that even though the modification I've made are extensive, they shouldn't have had any real impact on this; most of it was overhauling the battle system and title scene; I've just started with
maps. (I'm betting the problem is something extremely simple...hoping, at least.)
**Can't believe I forgot to mention this, these commands seemed to work fine a few days prior;
The only thing I've changed is adding an "and @delay != -1" at the end of an unless inside of
Game_Picture, which shouldn't be relevant, and cleaned up a few other things; again that shouldn't be relevant.
***This is actualy starting to get interesting; Ruby is my favorite language and I can't even begin to think what could be happening now. I made a new event whose only command was to run the script
[rgss]
$game_map.flux_setup
$game_map.pix_names
[/rgss]
Now, if I comment out either of the lines, everything works fine. However, if I combine both methods into a single method, then everything fails all over again; which is where I'm getting confused, since there is no good reasonf or this behaviour. Here is each method:
[rgss]def pix_names(arr = ["1", "2", "3", "4", "5", "6", "7"])
@images = arr.dup()
return true
end
def flux_setup
@flux = [[[-50, 50],[-75, 35],[-125, 35]],[28,48], "Circle", "Stars"]
return true
end
[/rgss]
As said, putting
[rgss]def names_plus_flux(arr = ["1", "2", "3", "4", "5", "6", "7"])
@images = arr.dup()
@flux = [[[-50, 50],[-75, 35],[-125, 35]],[28,48], "Circle", "Stars"]
return true
end
[/rgss]
Also, calling the flux_setup command with @flux as an attr_accessor causes the same error, even if it is by itself;
but remove the accessor, and it works.
****I haven't touched anything in the interperter except the commands used to display the message window, and they aren't causing the problem.