Help with script error where the scripter cannot

The script posted on this thread http://forums.rpgmakerweb.com/index.php?/topic/14925-iconic-crafting-system/ and which can be found pasted here:http://pastebin.com/zayhrtTW is returning an error message.  Unfortunately the scripter's PC has broken and he is unable to do anything about it.  He wondered if anyone else would be able to help.

The problem is as follows:

The script calls up a crafting menu, which has several options on it, one of which is 'Recipe' which allows the player to check the recipe for the item before adding any of the ingredients.  However, selecting it results in this error message:

Script'Iconic crafting system' line 1398: NoMethodError occurred

undefined method '[]' for nil:Nil Class.

I know that the recipes are correctly entered in the script because I can make them without any hitch.  It is just this action which produces the error. 

Can anyone help?  I've built an important strand of the game and story around being able to use this feature, and it would be a huge blow if it can't be fixed.

Thanks.
What doesn't make sense is that there are no brackets [] on that line...can you post a list of your scripts (and which ones are similar that might affect compatibility), or a demo explaining the error? With the current information, we can only derive that @repie isn't being initialized as a variable and thus erroring...one last question: are you using an error-catching script?

EDIT: Perhaps you should try this:

1) Jump to line 1343 of the script, which reads "while b < @rapie_len"

2) Click at the end of that line and press enter.

3) Press tab and/or space till the cursor is flush with the line below it.

4) Type (without the quotes) "if @repie.nil?; b +=1; next; end"

5) Test this and let us know if it works.
In the light of your comment, I double-checked that there is a [] in the error message, just in case, and there is.  I tried inserting the line you suggested, and the error still came up.  Here is the full list of scripts that I am using.  I've done a screen shot to ensure that there are no errors.

Spoiler
">http://s1323.photobucket.com/user/ksjp17/media/ScriptList_zps04adb0c3.png.html'>
ScriptList_zps04adb0c3.png
As for your final question, I'm afraid I don't even know what an error-catching script is.
Can you be sure that's exactly your version on the pastebin? You shouldn't get that error on that line, based on the pastebin.
Yes, version 1.5, dated 7/3/13
To get some more information on the script error, place the following code in the 'Main Process' section near the bottom of the script editor and temporarily comment out the single line of code which is already there :

rgss_main do begin SceneManager.run rescue Exception => ex puts ex.message puts ex.backtrace.join("\n") gets endendThe 'Main Process' section should then look something like this :
Code:
#==============================================================================# ** Main#------------------------------------------------------------------------------#  This processing is executed after module and class definition is finished.#==============================================================================#rgss_main { SceneManager.run }rgss_main do  begin    SceneManager.run  rescue Exception => ex    puts ex.message    puts ex.backtrace.join("\n")    gets  endend
Now, remember to select the 'Show Console' option from the 'Game' menu before starting a playtest instance of your game. When the 'RGSS Console' window pops up, left-click on the icon in the top-left and select 'Defaults'. In the 'Options' tab, select 'QuickEdit Mode' and press the 'Ok' button. Next, left-click on the icon once again, select 'Properties', select 'QuickEdit Mode' and then press the 'Ok' button again. What 'QuickEdit' does is allow you to copy text from the console window by left-clicking and dragging across text, then right-clicking on the selected text to copy to the clipboard.Begin the testplay of your game and try to force the error to occur. When the error does occur, the game window will become frozen. This is normal. Switch to the 'RGSS Console' window, select the error (left-click and hold at the upper left, then drag to the lower right of the message, then right-click on the selected text) then paste the error here. This should give everyone a better idea of where the problem lies (or at least, hopefully it will).
And here is what the console has:

undefined method `[]' for nil:NilClass
{0158}:1412:in `draw_recipies_to_window'
{0158}:1346:in `initialize'
{0158}:1270:in `new'
{0158}:1270:in `draw_windows_r'
{0158}:1258:in `start'
{0100}:12:in `main'
{0006}:23:in `run'
{0151}:969:in `run'
{0165}:10:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
{0165}:8:in `<main>'
ruby:in `eval'
 
try changing line 1412 to this:

draw_icon($data_items[@repie[😛roduct]].icon_index,0,yy,true) if @repie[😛roduct_type] == RPG::Itemand then see if the line for recipe_to_windows changes, so we can narrow down which [] it is.
This is what the console now shows after that alteration:

undefined method `[]' for nil:NilClass
{0158}:1412:in `draw_recipies_to_window'
{0158}:1346:in `initialize'
{0158}:1270:in `new'
{0158}:1270:in `draw_windows_r'
{0158}:1258:in `start'
{0100}:12:in `main'
{0006}:23:in `run'
{0151}:969:in `run'
{0165}:11:in `block in <main>'
:1:in `block in rgss_main'
:1:in `loop'
:1:in `rgss_main'
{0165}:9:in `<main>'
ruby:in `eval'

Is this what you wanted?
 
Hmm, it didn't do what I was hoping. When I asked you earlier if you're sure it's the same version, I meant that you didn't change it at all, right? The script you have loaded in your editor is exactly like the one on pastebin? No extra lines, no extra comments, no extras of any kind. Everything is identical? I'm most concerned about no extra lines or config settings, since those take up a number of lines? If you did add a new config setting, or you put empty lines somewhere, we need that version. We need to see exactly what you're seeing, or we won't be able to help you correctly.
Alright, so, in the configuration area where you set up the recipes, make certain that the 'product' is actually an item, weapon or armor within the database.

Example :

Code:
    :name => "Paralysis Rune",    :ingredients => [1,2],    :types => [RPG::Item,RPG::Item],    # This recipe will create an item ...    :product => 25,    # ... with the database ID of 25.    :product_type => RPG::Item,    # If this entry does not exist within the database, the script will crash with the 'NoMethod' error.    # So, make absolutely certain that the item, weapon or armor exists.    :amount => 1,    :discovered => true,    :sound => "Hammer",    :restrictions => nil,    :goldcost => 0,    :mpcost => 20,    :tpcost => 0
Otherwise, the script will attempt to locate and display the icon for an item, weapon or armor that does not exist, and explode.
Sorry for the delay in replying - the consequence of differing time zones.

@Zalerinian. 

No, my script is not identical, because I have to enter the recipes within it.  Therefore, by definition, it cannot be the same.  In terms of other configuration, I have to enter the actor id of the character who will have the skill.  Otherwise it is identical.  I don't know how to script, so I wouldn't ever risk doing anything other than the strictly necessary bits of configuration.

@Exhydra

Yes, all items are present in the data base.  However, things have either clarified or become more confusing, depending on what the significance is of the following:

To check your question thoroughly, I started taking the recipes out one by one.  It seemed everything was fine for the first 5 out of 7. 

So I started playing around with the final two to see what the issue was.  All items mentioned in the recipes are in the database.  So I then began by changing the number of the product, to see if that was the issue.  However, even changing the 'product' to item 1 still caused an error message.  This time, however, it was at line 1344, which reads:

[SIZE=12pt]if Recipe_List::RECIPE[:discovered] == true || $game_system.recipe_list_discovered[:discovered] == true[/SIZE]

 

[SIZE=12pt]The feature it is pointing to, i.e. discovered = true means that the character starts with that recipe already 'learned'.  If false, then they have to learn it at some stage in-game.  Recipes 3-7 are all false.  So I turned recipes 6-7 from false to true, and found that I could call up the recipe list from within the crafting menu.  So it seems that although the game is handling recipes 3-5 as false without a problem, it doesn't like these.[/SIZE]  I then went to use the recipe, just to make sure.  When I had entered the last item, I then got the NoMethodError occurred  undefined method '[]' for nil:Nil Class error message.  This time it referred to line 1036, which reads:

 

[SIZE=12pt]$game_system.recipe_list_discovered[:discovered] = true[/SIZE]

 

[SIZE=12pt]So it looks like something to do with the true/false part of the discovered aspect.  [/SIZE]

 

[SIZE=12pt]Hope this clarifies things.  It just leaves me more confused than ever.[/SIZE]
Hmm, could you paste the recipes in question into the thread?
Okay, 2 screen shots.  The first one shows 2 recipes which work

">

Here are the 2 recipes which don't work

">

I can't see the difference between them.
Oh, I meant actually copy and paste the text, as I was going to plug the recipes in to the script.
Oh, I see!  Sorry about that.  Here are all seven

Spoiler
 RECIPE[0] = {
    :name => "Health Brew",
    :ingredients => [52,53,54,55],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 1,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => true,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[1] = {
    :name => "Bright Eyes Lotion",
    :ingredients => [52,56,55],
    :types => [RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 15,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => true,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[2] = {
    :name => "Fire Guard Potion",
    :ingredients => [52,59,57,58],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 89,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[3] = {
    :name => "Magic Guard Potion",
    :ingredients => [52,61,61,63],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 90,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[4] = {
    :name => "Confusion Potion",
    :ingredients => [52,66,59,65],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 91,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[5] = {
    :name => "Stormy Day Potion",
    :ingredients => [52,62,53,65],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 92,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[6] = {
    :name => "Thunder Guard Potion",
    :ingredients => [52,66,53,56],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 90,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
    RECIPE[7] = {
    :name => "Ice Guard Potion",
    :ingredients => [52,65,66,53],
    :types => [RPG::Item,RPG::Item,RPG::Item,RPG::Item],
    😛roduct => 94,
    😛roduct_type => RPG::Item,
    :amount => 1,
    :discovered => false,
    :sound => "Magic2",
    :restrictions => nil,
    :goldcost => 0,
    :mpcost => 5,
    :tpcost => 0
    }
Bump.   Has anyone got any ideas about how this might be sorted?

Thanks

EDIT

I now have more information which may shed some light on this.

I think it's the number of recipes which may be the problem.  If I remove recipe 7, then things go okay.  I then switched the contents of recipe 3 and 7.  I can then craft the item that was contained in recipe 7, but can no longer craft the item in recipe 3.

Furthermore, if there are only 6 recipes in the list, I can call up the 'Recipe' slot on the crafting menu, but the cursor will only scroll down the first 2 recipes.

Could it be something to do with the way that it deals with higher numbers of recipes and with how that slot on the menu is drawn?

Original thread: https://forums.rpgmakerweb.com/threads/help-with-script-error-where-the-scripter-cannot.18212/