Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: firevenge007 on December 11, 2014, 09:11:22 pm

Title: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 11, 2014, 09:11:22 pm
So with winter break here, I decided I wanted to spend a little more time further developing my game. But recently, when I try to kill a monster successfully, and after pressing enter once the loot screen appears, I get an error:
Script 'LevelNotifier' line 307: NoMethodError occured.
undefined method 'size' for nil:NilClass


It redirects me to the script I've used which is "Easy LvlUp Notifier by Blizzard". The script can be found here: http://downloads.chaos-project.com/scripts/Easy%20LvlUp%20Notifier.txt (http://downloads.chaos-project.com/scripts/Easy%20LvlUp%20Notifier.txt).

The line it points to is:
    if @skill_texts.size > 0

I'm not very familiar with ruby, but after looking through the code, the only other instance I see of texts is on line 274 through 284:
def start_phase5
    start_phase5_lvlup_later
    @skill_texts = []
    $game_party.actors.each {|actor|
        actor.remove_states_battle
        if @lvlup_data[actor][0, 7] != [actor.level, actor.maxhp, actor.maxsp,
            actor.str, actor.dex, actor.agi, actor.int]
          @pending_windows.push(Window_LevelUp.new(actor, @lvlup_data[actor]))
          @skill_texts.push('')
          new_skills = actor.skills - @lvlup_data[actor][8]
          if new_skills.size > 0
            new_skills.each {|id|
                @skill_texts.push("#{actor.name} learned #{$data_skills[id].name}!")}
          end
        elsif @lvlup_data[actor][7] != actor.exp && !NO_EXP_DISPLAY
          @moving_windows.push(Window_LevelUp.new(actor, @lvlup_data[actor]))
        end}
  end


I'd really appreciate if anyone had the time to tell me what the problem is exactly. I'm thinking that it has to do with other scripts interfering, but even if I place the class higher up in the list of classes, nothing seems to change.

Thanks for your time.
Title: Re: Getting an odd error I've never seen before after killing something
Post by: KK20 on December 11, 2014, 09:22:58 pm
Are there any other scripts that modify the method start_phase5 without aliasing it?
Title: Re: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 11, 2014, 11:31:12 pm
Not that I see. I'd be glad to send you my scripts though.
Title: Re: Getting an odd error I've never seen before after killing something
Post by: KK20 on December 11, 2014, 11:41:34 pm
Yeah you can send me the scripts file.
But you did do CTRL + SHIFT + F and searched for def start_phase5 and checked to see if any of them had an alias before the method declaration?
Title: Re: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 11, 2014, 11:56:56 pm
Yes I tried that.

Here are my scripts. Thanks for looking into this. It's quite mysterious since I haven't touched it since the beginning of the schoolyear.
https://www.dropbox.com/s/kf8x6e0t2tg6ni0/Scripts.rxdata?dl=0 (https://www.dropbox.com/s/kf8x6e0t2tg6ni0/Scripts.rxdata?dl=0)
Title: Re: Getting an odd error I've never seen before after killing something
Post by: KK20 on December 12, 2014, 12:19:17 am
Well not quite it seems.
Spoiler: ShowHide
(http://puu.sh/drdM1/f8e1c9f46a.png)

Multi-Drop is rewriting start_phase5 without an alias. Any scripts placed above it that defines start_phase5 will be ignored/completely wiped out. Your LevelNotifier is currently above it.

Plus, you really should have seen Blizzard's script order (http://forum.chaos-project.com/index.php/topic,23.0.html) topic and placed TONS above your scripts.
Title: Re: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 12, 2014, 01:57:02 am
I put it at the top to see if it would change anything, which it didn't and I didn't bother to move it back to the bottom where it was originally.
Title: Re: Getting an odd error I've never seen before after killing something
Post by: KK20 on December 12, 2014, 02:09:25 am
So...is it fixed or what?
Title: Re: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 12, 2014, 02:21:21 am
Having it at the bottom did not work nor did it at the top. I'm not sure how it would be fixed if it were to be put at the bottom again?
Title: Re: Getting an odd error I've never seen before after killing something
Post by: KK20 on December 12, 2014, 02:53:11 am
Well I just tried moving the Level Notifier below TONS and it seemed to work. Going to try moving TONS up now.

EDIT: Okay, you have two other scripts that completely rewrite start_phase5 without an alias, found in 'GoldXP' and 'Extra' scripts. As such, you have to make sure Tons and those two scripts are placed above the Level Notifier script.
Title: Re: Getting an odd error I've never seen before after killing something
Post by: firevenge007 on December 12, 2014, 03:10:42 am
So would it work if I had:
TONS
GoldXP
Extra
Level Notifier?

Thanks again