NoMethodError Occured. Undefined Method: 'empty?' for nil:NilClass

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
Hello I'm using Szyu's Crafting System script, and it was working just yesterday but today I go in and I haven't changed a thing, but every time I try to craft something I get this error. It gives me the error on line 175. I'm really bummed out about this and would like some help. Thanks.
# Pastebin:
#
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
You should put links to scripts. In this case a link to the post by Szyu, not the script itself.
This is also script support not general help.
I have no idea how this crafting script works. I don't know what I'm suppose to set up. The instructions are very confusing to me.
Can't tell where the information is suppose to go.
Can you provide info on your setup so I may test?
 

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
You should put links to scripts. In this case a link to the post by Szyu, not the script itself.
This is also script support not general help.
I have no idea how this crafting script works. I don't know what I'm suppose to set up. The instructions are very confusing to me.
Can't tell where the information is suppose to go.
Can you provide info on your setup so I may test?
I'm so sorry I'm new to the forums.. I'm not sure where anything goes.. And I put the paste bin link, Next time ill provide a link to a forum.

So first I set up a recipe book. Which is an item. Then I add its recipes. This is all under the notes of the item.
<recipe book>
<recipes>
w: 13 <-- this means it contains the recipes of weapon ID 13
</recipes>

Then under weapon ID 13 I set the ingredients.
<ingredients>
i: 1x 4 <- it costs 1 of item ID 4.
</ingredients>

Then I set up an event to call the script.

SceneManager.call(Scene_Crafting, -1)

^ this calls the script and opens up the crafting menu.

then to craft things it is fairly straight forward from there.

I also set up an event to give the player the RECIPE BOOK and the materials needed to craft say weapon 13.

That's it.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
go into the Main script and replace the SceneManager.run part for
Code:
def report_exception(error)
  scripts_name = load_data('Data/Scripts.rvdata2')
  scripts_name.collect! {|script|  script[1]  }
  backtrace = []
  error.backtrace.each_with_index {|line,i|
    if line =~ /{(.*)}(.*)/
      backtrace << (scripts_name[$1.to_i] + $2)
    elsif line.start_with?(':1:')
      break
    else
      backtrace << line
    end
  }
  error_line = backtrace.first
  backtrace[0] = ''
  err_class = " (#{error.class})"
  back_trace_txt = backtrace.join("\n\tfrom ")
  error_txt = sprintf("%s %s %s %s %s %s",error_line, ": ", error.message, err_class, back_trace_txt, "\n" )
  print error_txt
  return error_txt
end
begin
  rgss_main do
    begin
      SceneManager.run
    end
  end
rescue SystemExit
  exit
rescue Exception => error
  error_txt = report_exception(error)
  print "Submit the file \"ErrorLog.txt\" in your project folder to the upper most script creators noted in the message.\n"
 
  filename = "ErrorLog.txt"
 
  File.open(filename, 'w+') {|f| f.write(error_txt + "\n") }
  raise  error.class, error.message, [error.backtrace.first]
end
bunch of code

make sure you have the console enabled, and go trigger that error again.
then, go to the console and screenshot the error track.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
.empty? is not called on line 175 of that script. If you are getting that error on that line, then you have made modifications to the script or you have not pasted it into your project correctly. I suggest you remove the script and re-add it, making sure you're copying the full thing and pasting it in its entirety.

In fact, that script doesn't use .empty? at all! Are you SURE it's that script that's giving the error message? You don't have two script slots with the same name, do you?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[move]RGSSx Script Support[/move]
 

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
.empty? is not called on line 175 of that script. If you are getting that error on that line, then you have made modifications to the script or you have not pasted it into your project correctly. I suggest you remove the script and re-add it, making sure you're copying the full thing and pasting it in its entirety.

In fact, that script doesn't use .empty? at all! Are you SURE it's that script that's giving the error message? You don't have two script slots with the same name, do you?
I am positive It is that script giving me the message. I was confused on this too. It turns out, by removing line 175 my problem was fixed. Everything works correctly but it jsut won't play the sound effect anymore. which sucks.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
.empty? is not called on line 175 of that script.
I am positive It is that script giving me the message. I was confused on this too. It turns out, by removing line 175 my problem was fixed
you are both correct.
the line in question could be triggering a sequence of events that run behind the scenes and cause that error.

that's why I posted that code, which will dump the entire trace of the error
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
I fail to understand how RPG::SE.new(....).play would yield a such error.
I'm intrigued to learn the error backtrace from gstv87 script snippet if that particular line was the cause, but I'm sure it wasn't the cause
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you don't understand what's going on, you definitely don't want to be removing lines.

What have you set up as your CUSTOM_CRAFT_SOUNDS_BY_TYPE on line 66?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
I fail to understand how RPG::SE.new(....).play would yield a such error.
It's simple, it's one of the many useless and faulty checks the default code makes.
This particular one checks if the filename of the sound effect is empty or not. They could have easily used another check which would not yield such an error, but they choose this empty? check which is prone to cause errors when the thing checked is actually a nil value instead of a string.

You either removed one sound effect settings from the item/weapon/armor SE settings, or you didn't setup new ones for the category SE settings.

If you don't want to bother with your settings (but you should...), you can just put this line:
Code:
csf = ""
Above this one:
Code:
    if @cr_category != -1
This will prevent the error from triggering, but if you miss an SE setting, no SE will be played.
 

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
go into the Main script and replace the SceneManager.run part for
Code:
def report_exception(error)
  scripts_name = load_data('Data/Scripts.rvdata2')
  scripts_name.collect! {|script|  script[1]  }
  backtrace = []
  error.backtrace.each_with_index {|line,i|
    if line =~ /{(.*)}(.*)/
      backtrace << (scripts_name[$1.to_i] + $2)
    elsif line.start_with?(':1:')
      break
    else
      backtrace << line
    end
  }
  error_line = backtrace.first
  backtrace[0] = ''
  err_class = " (#{error.class})"
  back_trace_txt = backtrace.join("\n\tfrom ")
  error_txt = sprintf("%s %s %s %s %s %s",error_line, ": ", error.message, err_class, back_trace_txt, "\n" )
  print error_txt
  return error_txt
end
begin
  rgss_main do
    begin
      SceneManager.run
    end
  end
rescue SystemExit
  exit
rescue Exception => error
  error_txt = report_exception(error)
  print "Submit the file \"ErrorLog.txt\" in your project folder to the upper most script creators noted in the message.\n"
 
  filename = "ErrorLog.txt"
 
  File.open(filename, 'w+') {|f| f.write(error_txt + "\n") }
  raise  error.class, error.message, [error.backtrace.first]
end
bunch of code

make sure you have the console enabled, and go trigger that error again.
then, go to the console and screenshot the error track.

Okay so I did that... I'm not quite sure what the "console" is at all.

I ended up pinpointing the error to the "Basic Options Menu" Script that I have implemented.

I'm also getting another error in the Game Interpreter.

It says wrong number of arguments, 2 for 1.

This is fixed when I use the script call Scene_Manager.call(Scene_Crafting) But this means that the player can create any sort of weapon/armor/potion/food anywhere I call the scene, and not just specific ones.

So apparently this new error is because I have an invalid number of arguments.

If all else fails I will just remove the crafting at specific stations entirely, and have them all be from the menu.

Thank you everyone for your help!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
that's a different issue and you should post it in its own thread. If THIS issue is resolved, you can then report the post and ask the mods to close it.
 

Zion774

Veteran
Veteran
Joined
Jul 24, 2015
Messages
40
Reaction score
1
First Language
English
Primarily Uses
that's a different issue and you should post it in its own thread. If THIS issue is resolved, you can then report the post and ask the mods to close it.
Will do
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,017,004
Members
137,562
Latest member
tamedeathman
Top