• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Closing the Options screen causes a crash

Allgamesdude

The Creator of the WIP game, Pokémon Cosmic. Looki
283
Posts
11
Years
  • Hi All. My options on the load/mystery gift/ new game menu is broken! When I open it, I hit escape without making any changes, and this shows up! It's never happened before, and I've just now finished most of my town and city maps! I really don't want to start all over again! Can someone help?

    This is the error:

    Exception: NoMethodError
    Message: undefined method `dispose' for nil:NilClass
    PokemonMessages:1124:in `pbDisposeMessageWindow'
    PokemonOptions:462:in `pbEndScene'
    PokemonOptions:479:in `pbStartScreen'
    PokemonLoad:432:in `pbStartLoadScreen'
    PokemonLoad:432:in `pbFadeOutIn'
    PokemonLoad:432:in `pbStartLoadScreen'
    PokemonLoad:319:in `loop'
    PokemonLoad:452:in `pbStartLoadScreen'
    DebugIntro:6:in `main'
    Main:37:in `mainFunctionDebug'
     
    14
    Posts
    10
    Years
    • Seen Aug 17, 2014
    I'm not an expert when it comes to scripts, but something apparently went wrong with them. Did you edit anything in there before this happened?
     
    65
    Posts
    9
    Years
  • Well, I'm not sure what happened in your scripts, but you can always import your old maps to a new project. Just copy the MapXXX.rxdata from the Data Folder and paste it to a new project. All your events will be imported too.
     
    1,405
    Posts
    11
    Years
  • You can do what RiceGate said and move all maps, graphics and .txt files to a new folder. The only thing you are gonna need to do over again is flagging the tileset you are using.
     
    14
    Posts
    10
    Years
    • Seen Aug 17, 2014
    Yeah. RiceGate has a good idea; in fact, if your Essentials isn't fully up to date, this may be a chance to get a hold of a newer version. On the other hand, I don't think importing anything will be necessary. Granted, it would probably be easier, but just for the sake of choice (or if it happens again, perhaps even for curiosity) I'll continue with the scripts thing...
    I did a bit of research and your error message tells us precisely where the problem is - somewhere within PokemonMessages, PokemonOptions, PokemonLoad, DebugIntro, and Main. It even gives us the lines to check. It might be one, or it might be all, I'm not sure.
    Anyway, I looked into it and these are the scripts on the lines given, in order:
    if item.respond_to?("icon_name")
    Kernel.pbDisposeMessageWindow(@sprites["textbox"])
    @scene.pbEndScene
    pbFadeOutIn(99999) { screen.pbStartScreen }
    sscreen.pbStartLoadScreen
    $scene.main
    If there are any discrepancies, I suppose we know what went wrong?
     
    65
    Posts
    9
    Years
  • You can do what RiceGate said and move all maps, graphics and .txt files to a new folder. The only thing you are gonna need to do over again is flagging the tileset you are using.

    Well, I'm not sure because I never tried it, but if he moves the Tilesets.rxdata to the new project, I don't think that he will need to flag the tilesets again.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    nope. not to the options script or anything that references at least.
    What did you change, then? Not even I fully appreciate how changing one thing can affect something seemingly unrelated. It's best to not just assume what you'd done is unrelated, given that you're asking for help.
     

    Allgamesdude

    The Creator of the WIP game, Pokémon Cosmic. Looki
    283
    Posts
    11
    Years
  • I originally tried to add mej71's Multiple Save FIle Script, and then it lead me to some errors. I then decided to revert back to the old Save and Load which is in Essentials default. I got a clean copy of Essentials and copied PokemonLoad and PokemonSave into my game. Then, I tried to playtest, and just to make sure nothing went wrong, I went to the options menu, and it crashed.
     
    1,224
    Posts
    10
    Years
  • If you were getting errors from my script, you should post them in that thread and I could help you with them. My script didn't change anything about PokemonOptions, did you change anything else?
     

    Allgamesdude

    The Creator of the WIP game, Pokémon Cosmic. Looki
    283
    Posts
    11
    Years
  • Ok, GoneForToday.

    I compared your post to my essentials, and found some discrepancies. I don't know if I should switch them to ones you said, or what.

    So here it is..

    In PokemonMessages:

    Line 1124.

    msgwindow.dispose

    In PokemonOptions:

    Line 426.

    Kernel.pbDisposeMessageWindow(@sprites["textbox"])


    Also in PokemonOptions:

    Line 479.

    @scene.pbEndScene

    In PokemonLoad:

    Line 432:

    pbFadeOutIn(99999) { screen.pbStartScreen }


    Also in PokemonLoad:

    Line 319:

    loop do


    Also in PokemonLoad:

    Line 452:

    end

    In DebugIntro:

    Line 6:

    sscreen.pbStartLoadScreen

    And Finally, in Main:

    Line 37:

    $scene.main

    Those were the lines that I made out from the error message. I hope those are what you were talking about GoneforToday.


    Thanks

    Pokegod7020
     
    14
    Posts
    10
    Years
    • Seen Aug 17, 2014
    Those were the ones, yep! The only difference is in that first one, but it may simply have to do with us having different versions of Essentials - I used ctrl+f to find "msgwindow.dispose" on line 1080, the only instance of it that I could find. Between line 1077 and line 1081(in my version anyway) there's some sort of definition, I suppose they're called? So, go back to line 1124 in PokemonMessages. Does the area look like this?
    def Kernel.pbDisposeMessageWindow(msgwindow)
    $game_temp.message_window_showing=false if $game_temp
    $game_message.visible=false if $game_message
    msgwindow.dispose
    end
    If not, or if something isn't quite the same, put down what you find and we'll go from there.
     

    Allgamesdude

    The Creator of the WIP game, Pokémon Cosmic. Looki
    283
    Posts
    11
    Years
  • So, GFT, this is what my pokemonmessages looks like around line 1124.

    def Kernel.pbDisposeMessageWindow(msgwindow)
    $game_temp.message_window_showing=false if $game_temp
    $game_message.visible=false if $game_message
    msgwindow.dispose
    @Arrow.dispose if @Arrow
    @Restriction.dispose if @Restriction
    end

    And yours is this one.

    def Kernel.pbDisposeMessageWindow(msgwindow)
    $game_temp.message_window_showing=false if $game_temp
    $game_message.visible=false if $game_message
    msgwindow.dispose
    end

    The main difference I see, I have no idea why, is this:
    @Arrow.dispose if @Arrow
    @Restriction.dispose if @Restriction

    It could have something to do with Carmaniac's Speech Bubble script, but I doubt it.
     
    14
    Posts
    10
    Years
    • Seen Aug 17, 2014
    Weird. I take it that you didn't put them there, then?
    Well, I suppose you could try removing those two lines and then see what happens. If that causes a new error, you can always put them back in.
    In the meantime, I'll see if I can take a look at those Speech Bubble scripts. As Maruno said previously, it's hard telling what's related and what's not.

    EDIT: Never mind. I set up Carmaniac's script myself, and "@Arrow.dispose if @Arrow" and "@Restriction.dispose if @Restriction" probably have a function similar to "msgwindow.dispose". Removing those particular lines didn't cause me any errors - probably because I didn't use the scripts for anything. I'm going to look into the message error itself. Also, this may seem random, but what version of Essentials do you have?
     
    Last edited:
    14
    Posts
    10
    Years
    • Seen Aug 17, 2014
    Ah. I was thinking it might've been an issue with script compatibility but, apparently, it has nothing to do with it?
    Now, looking back at that error message -
    Exception: NoMethodError
    Message: undefined method `dispose' for nil:NilClass
    And what's on the line it first specifies -
    msgwindow.dispose
    I kinda feel silly for not seeing it sooner, but that's precisely what your problem is. It's looking for a method to use, but it's not finding anything. Something as simple as a missing period or a misspelling can render a script useless. Not knowing scripts as well as I should, I can't say for certain where the method it's looking for should be; I could only guess. It might be somewhere in the definition on the lines 1010 to 1024 but, again, I'm not sure. It would probably be best just to replace everything in PokemonMessages.
     
    Back
    Top