undefined method >='for nil:NilClass

Discussion in 'RGSSx Script Support' started by AtomosomotA, Aug 9, 2014.

Thread Status:
Not open for further replies.
  1. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    I'm getting a crash in my game as soon as the command window comes up. I'm using Moghunters Battle HUD Ex "Wildflower" version, and just recently have been experiencing crashes associated with it when I have more than one actor in a party. The first fight after game start will not experience a crash if I have only one actor but with 2+ the chance of a crash is 100%. Strangely, if I finish the battle with the one actor and gain another or 2 or 3, the second battle may not experience a crash at all. Seems to me, the odds of a crash go higher, the more actors I have in the party.


    Heres the crash specifically:


    Script 'Game_Actor' line 684: NoMethodError occured.


    undefined method >='for nil:NilClass


    Upon returning to the editor and checking the scripts, "line 684" is directed to the Game_Actor Script under Game Objects that is included in the RTP version of the game..


    Specifically the "To Next Command Input" section:

    #--------------------------------------------------------------------------
      # * To Next Command Input


      #--------------------------------------------------------------------------


      def next_command


        return false if @action_input_index >= @actions.size - 1    <-THIS LINE


        @action_input_index += 1


        return true


      end
    UPDATE1: List of all the scripts I have in use, in the order I have them in. (No links just yet, hoping this alone will be enough)

    --MATERIALS--
    1. 8 Dir Move - JV Master Script


    2. Game Over Common Event Author: Kread-EX Version 1.02


    3. Galv's Jump Ability Author: Galv


    4. Galv's Vehicle On Off Locations Author: Galv


    5. Map Drops Author: Hime


    6. Yanfly Engine Ace - Ace Message System v1.05


    7. Advanced Game Time + Night/Day v1.5.1b Author: Vlue


    8. Khas Awesome Light Effects Author: Khas Arcthunder


    9. Symbol Encounter Simplifying Script 1.01 Written by Rokan http://kaisou-ryouiki.sakura.ne.jp/ Translated by kirinelf


    10. Falcao Interactive system 2.0


    11. Falcao Int System Tool Selector + service pack


    12. Mode 7 Ace v.1.8 Author : MGC


    13. Mode 7 Ace Addon : Airship v.1.2 Author : MGC


    14. CP Gradient Text script Version 1.3 Author: Neonblack


    15. Item Rarity Author: Hime


    16. Galv's New Item Indication v1.5


    17. REGION COMMON EVENTS v1.0 Author: Shaz


    18. Basic Climate System v2.2 Author: Vlue


    19. Quest Journal [VXA] Version: 1.0.3 Author: modern algebra (rmrk.net)(http://rmrk.net/index.php/topic,45127.0.html)


    20. XaiL System - Core Author: Nicke Version: 2.1f


    21. XaiL System - Menu Delux Author: Nicke Version: 1.1b


    22. Draw Generic Gauge - KMS_GenericGauge Translated by Mr. Bubble Website: http://ytomy.sakura.ne.jp/


    23. Compatibility Patch : XaiL System Menu Delux + KMS Generic Gauge Author: Mr. Bubble


    24. Yanfly Engine Ace - Ace Equip Engine v1.06


    25. Yanfly Engine Ace - Ace Item Menu v1.02


    26. Yanfly Engine Ace - Ace Skill Menu v1.01


    27. Yanfly Engine Ace - Ace Status Menu v1.02


    28. Yanfly Engine Ace - System Options v1.00


    29. Yanfly Engine Ace - Ace Shop Options v1.01


    30. Compatibility Patch : YEA System Options + KMS Generic Gauge Author: Mr. Bubble


    31. MOG - Menu Cursor (V1.7) Author: Moghunter (http://www.atelier-rgss.com)


    32. Yami Engine Symphony - Battle Symphony Version: 1.16d


    33. MOG - Battle Hud EX (v3.8) Author: Moghunter (http://www.atelier-rgss.com)


    34. MOG - ATB System (v 1.4) Author: Moghunter (http://www.atelier-rgss.com)


    35. Yanfly Engine Ace - Victory Aftermath v1.04


    36. Compatibility Patch : YEA Victory Aftermath + KMS Generic Gauge Author: Mr. Bubble


    37. Basic Enemy HP Bars Lite v 1.1b Author: Vlue


    --MAIN--
     
    UPDATE2: As recommended I ran "Mithran's Crash Debugger" in my game.


    This is the result:

    -----


    Time: 2014-08-10 22:46:09 -0500


    Memory Leak #<GameTime::Sprite_TimeTint:0x8212ac0>


    In Scene NilClass


    Creation Stack:: 


    Script 0129 -- Advanced Game Time + Night/Day, Line: 214:in `run'


    Script 0129 -- Advanced Game Time + Night/Day, Line: 707:in `<main>'


    ruby:in `eval'


    At first glance it seemed to point to Vlues Advanced Time Script as conflicting with the ATB. Upon contacting Vlue, I followed his recommendation to remove his script. Even with Vlue's script, "Advanced Game Time" completey removed, the issue remains. 


    My apologies to Vlue for jumping to conclusions.

    Heres the ATB script that is in conflict:


    If there is any other information you need to help me with my problem, please ask!!


    Thank you all for your time and trouble. Thank you.


    ~AtomosomotA


    NOTE: I recently sent a link to my project to a few members. If anyones interested in playing it as to help me fix my issue please PM me. Thank you.
     
    Last edited by a moderator: Aug 27, 2014
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,635
    Likes Received:
    6,576
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Please link to the scripts you're using, that would help us solve the problem.


    But first: does this happen when your start a new game, or only when you load an old savegame?


    Because in 95% of all cases, errors with "undefined for nil:class" happen when you add a script but forget to start a new game after adding the script - a lot of scripts invalidate old savefiles when being added to the project.
     
    #2
    RachelTheSeeker and AtomosomotA like this.
  3. Evgenij

    Evgenij Veteran Veteran

    Messages:
    349
    Likes Received:
    100
    First Language:
    German
    Primarily Uses:
    N/A
    There shouldnt be any errors on default scripts as long as you dont have touched them. I assume you have maybe copied your custom scripts to the wrong place. They have to go under Materials but before Main
     
    Last edited by a moderator: Aug 9, 2014
    #3
    AtomosomotA likes this.
  4. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,454
    Likes Received:
    3,723
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Yeah, this is a weird one.  There's no reason that @action_input_index shouldn't be recognized as a valid integer class variable.

    Do a Find All in your project (Ctrl + Shift + F) for action_input_index (without the @) and let us know what comes up (or simply check it against a clean project).  Also, check to see whether the initialize method for this class was overwritten by any of the scripts you're using.

    You might also be able to comment out entire scripts (Ctrl + Q) one at a time to see which script seems to be causing the conflict and narrow it down a little further.

    EDIT: And before you do all that, make sure it's not the "old save file" thing that Andar mentioned.

    EDIT 2: There's also at least one other thing that could cause this type of error: if you have a class call that method, and there's a nil instance of the class trying to call it.  For example, if you have an array that holds up to ten objects, and each one ("for i in 0..9") calls the method, but only four objects have actually been populated into that array, the fifth one will give you that NilClass problem, I think.  There are ways to fix this like "for i in 0..(my_array.size - 1)", but first, figure out whether any scripts might be doing something like this.
     
    Last edited by a moderator: Aug 9, 2014
    #4
    AtomosomotA likes this.
  5. Milena

    Milena The woman of many questions Veteran

    Messages:
    1,282
    Likes Received:
    106
    Location:
    Ireland
    First Language:
    Irish
    Primarily Uses:
    N/A
    @action_input_index >= @actions.sizeeither one of these instance variables aren't being read or initialized.
     
    #5
    AtomosomotA likes this.
  6. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    It's @action_input_index, not @actions or @actions.size - if either of those weren't defined, the error message would be different.


    >= refers to the variable that comes before it.
     
    #6
    AtomosomotA likes this.
  7. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    Sorry everyone. It was late into the night when I made this post, I was having some internet issues and honestly I lost track of it..

    Let me reply starting with the first question:

    I start a new game everytime.. as it is a game in progress and I like to test it from the beginning a million times... :)

    Also, I could link to all my scripts but, actually how about I just send you a copy of my project, seems a bit easier to determine the problem as a whole dont you think? I'm sending you a link to my project through Google Drive.

    They are all subcategorized under materials and above main as they should be..

    Hmmm, same as I told Andar. 1.) I do start a new game everytime and 2.) I will send you my project as is if you're interested..

    I'm also sending you a link to my project through Google Drive.

    Hmmm, what would cause this do you think?

    So its a variable problem?  :stare:
     
    Last edited by a moderator: Aug 11, 2014
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I was replying to Milena who was saying that either @action_input_index OR @actions.size was not defined. The issue only involves one of them, not both.


    In answer to your question about providing links to the scripts, it is HIGHLY preferable for you to provide links to the scripts, rather than a download of your game. It might take someone 5 minutes to follow a script link, take a look at the line in question (or what's calling it), and come up with some possibilities. Everyone here pretty much is making their own game. They don't have time to 1: download your game 2: try and figure out how to replicate the problem you're having 3: search through all your scripts to see where the problem might be.


    Basically, it's most often easier to solve problems by you just pointing to the scripts (via links). If it can't be resolved that way, THEN someone might request a copy of your game to take a look at. But generally don't do that unless they ask for it, as going to that effort is a burden on you and on them, that may not be necessary.


    One thing I know you will be asked to do soon, is to locate Mithran's Crash Debugger (it's probably pinned at the top of the RGSS3 Scripts forum) and install that into your game - play until it crashes, then take a screenshot of the console. This will show not only the line with the error, but where it's been called from, and where that's been called from, and so on. It will often help identify the REAL script that has the problem, as sometimes the cause is somewhere other than the line given to you in the error message (and I think it will be, in this case, as there's generally not a problem with that line).
     
    #8
    AtomosomotA likes this.
  9. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    I see, very understandable.. Though I have already sent links to a couple members, I will do as you say and link my scripts as well as try out the debugger. 

    I will edit my main post as soon as I get all the links for my scripts together. Pressed for time atm so may be towards the end of the night.

    Thank you very much for your input on my issue Shaz! 

    EDIT1: WOW! I have 32 scripts already... I'll try by the end of the night but this might take me a while longer as I'll have to locate a couple of the less common ones..
     
    Last edited by a moderator: Aug 11, 2014
    #9
  10. Andar

    Andar Veteran Veteran

    Messages:
    28,635
    Likes Received:
    6,576
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Bad move.
    You should always keep the links to the pages where you got your resources from in your browser - not only to be able to check if there had been an update or a bugfix, but you are also required to credit the script writers in your game - and that's difficult if you don't know where you got them
     
    #10
  11. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    So I found the issue, but hopefully you guys can still help me..

    It seems to be an issue between Vlue's Advanced Game Time Script and Moghunters ATB System....

    Update: I was very INCORRECT!! Even without Vlue's time script the error persists...

    It is however, still an issue with Moghunters ATB and ...... another script.... for the life of me, I know not which one...
     
    Last edited by a moderator: Aug 15, 2014
    #11
  12. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Do not post scripts in your threads. Link to the original. For several reasons I won't go into here.


    The simplest thing to try would be changing their order. Might work, might not.
     
    #12
  13. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    This particular script is part of a demo by moghunter, thats packaged in with many other scripts...

    I thought it would be much more convenient, to copy the script into my post, instead of expecting someone to go download the demo, and find the exact script I'm using on their own...

    Not that I dont understand why you would say such a thing... most people do not want there scripts, materials, etc reposted all over the place... totally understandable.

    I HAVE tried to contact Moghunter myself, to no avail... and will delete the script as soon I find a fix to my issue.

    I have rearranged my scripts many times in an attempt to try to rid this error... thank you for the suggestion though. :)
     
    Last edited by a moderator: Aug 12, 2014
    #13
    Milena likes this.
  14. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    oh, okay then. When you do post a script, pop code tags around it to make it more readable and preserve the formatting.


    It might be easier for someone to check out if you do up a demo project with all your scripts as they are, and whatever settings in the database are needed, and an autorun command that will cause the error to trigger just about straight away.
     
    #14
    AtomosomotA likes this.
  15. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    Hmmm, the autorun event is a good idea, I should've thought about that. As it stands, I have a couple instructions pop up at the start of the demo to tell you how to trigger it. I might repackage it with your recommendation in mind if I cant figure it out soon..
     
    #15
  16. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    Removed references to it being an issue with Vlue's Advanced Time Script, it is NOT the issue... although, Moghunters ATB is still conflicting with another script somewhere..

    Btw, if you haven't checked the main post in a while and you're trying to help me, you may want to look it over.. Thank You! Thank you all....
     
    #16
  17. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Wanna zip it up and load it online somewhere? Someone might be able to have a look through it. Just make sure you either set the starting position or use a save file that causes the issue to happen almost immediately, and provide instructions on how to trigger it (what command window?)


    Don't put it on 4shared - I can't download from there, and I don't have the time or interest to figure out why.


    Alright - it's quite easy, and exactly what we said.


    @action_input_index is nil. That means next_command is being called before clear_actions.


    I solved the problem by adding a line to Game_Actor.setup at the end to clear_actions, but that may not be the best solution. I suggest you check the original script and see where that variable is initialized, as you may have missed either initializing the variable or calling clear_actions when merging it with the RTP scripts.


    edit: please ask for help in the forum, not via PM. As I said, in the forum, others can see the solution as well.


    Go to Game_Actor and find the method setup.


    As the last line of that method, just before end, add the following line:

    clear_actions
    As I said though, I'm not sure that's the best solution. It got it working for me, but it may cause issues in other situations. What you really need to do is go back to the original script (ATB) and go through it carefully, as you must have missed something when merging it in with the RTP scripts. If you missed that, you could have missed other things as well.
     
    Last edited by a moderator: Aug 15, 2014
    #17
    AtomosomotA likes this.
  18. AtomosomotA

    AtomosomotA GRODE Leader Veteran

    Messages:
    38
    Likes Received:
    3
    Location:
    Granseal
    First Language:
    English
    Thank you so much Shaz!!

    It IS working, and I do applaud you Shaz, but I am curious to know if you or anyone else has\ can come up with any other way of fixing this... as I worry, that changing the RTP scripts, as you have noted, may cause problems in the future.

    Thank you..
     
    #18
  19. Shaz

    Shaz Veteran Veteran

    Messages:
    37,806
    Likes Received:
    11,511
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    :) Three times lucky ... you need to go back and look at the original script and see if you missed something when you merged the commands with your RTP


    If nobody else using the original script is having this problem, it is because you changed or missed something when you copied the commands into your scripts. Nobody else can help you with that. You need to work through it again.


    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
     
    #19
Thread Status:
Not open for further replies.

Share This Page