• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Scottie, Todd, Serena, Kris - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Game crashing caused by a berry tree added before v15

Savordez

It's time to end fangames.
  • 101
    Posts
    11
    Years
    [PokeCommunity.com] Game crashing caused by a berry tree added before v15

    The berry tree in the .gif doesn't seem to cause any problems because I added it after upgrading to v15. The berry tree that's causing my problem is located in a city a few steps away from the location shown and its berries were picked. The save file was created in an older version of my game (also before upgrading to v15).

    Here's the error log (because it's kinda hard to catch it from my .gif):
    Spoiler:

    Is there a way to fix this or is a new save file required?
     
    Last edited:
    Is there a reason you cannot just... create a new berry tree and recompile?
     
    Is there a reason you cannot just... create a new berry tree and recompile?

    This is due to the fact that there is no hours variable that corresponds to this line
    Code:
    if timeDiff>=hours*4*3600
    Berry Tree events created before v15 would still be using old mechanics, so this line would show up for that. The events' data are stored in the save file in this case, saved in $PokemonGlobal. He would have to start a new save file for them to be created with the new mechanics.
     
    See what mej said, and replace hours with timeperstage in that line. No reset required.

    I tried to make the berry trees work for both sets of mechanics, where the set is what the Setting for it was when the berry was planted (so even if you change to the other, that particular berry plant will still use its original mechanics). I haven't tested this thoroughly, though.
     
    Oh, gee. The berry tree in question is now invisible and you get this error if you interact with it:
    Code:
    Message: Script error within event 8, map 34 (Berrygrove City):
    Exception: TypeError
    Message: Section041:559:in `[]'no implicit conversion from nil to integer
    ***Full script:
    pbBerryPlant
    
    Interpreter:243:in `pbExecuteScript'
    PBIntl:559:in `get'
    PBIntl:669:in `get'
    PBIntl:706:in `pbGetMessage'
    (eval):540:in `getName'
    PokemonBerryPlants:444:in `pbBerryPlant'
    (eval):1:in `pbExecuteScript'
    Interpreter:1606:in `eval'
    Interpreter:243:in `pbExecuteScript'
    Interpreter:1606:in `command_355'
    
    Interpreter:276:in `pbExecuteScript'
    Interpreter:1606:in `command_355'
    Interpreter:494:in `execute_command'
    Interpreter:193:in `update'
    Interpreter:106:in `loop'
    Interpreter:198:in `update'
    Scene_Map:103:in `update'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `update'
    Scene_Map:68:in `main'
    Can this be fixed by doing what Worldslayer608 suggested? o_o
     
    Your error message says that the plant isn't invisible, it's just not there. You're interacting with an empty patch of land.

    Go to about line 383 and find this:
    Code:
      case berryData[0]
      when 0  # empty
        if NEWBERRYPLANTS
          # Gen 4 planting mechanics
          if [COLOR=Red]!berryData[7] || [/COLOR]berryData[7]==0 # No mulch used yet
            cmd=Kernel.pbMessage(_INTL("It's soft, earthy soil."),[
                                _INTL("Fertilize"),
                                _INTL("Plant Berry"),
                                _INTL("Exit")],-1)
            if cmd==0 # Fertilize
    Add the red part. Try that.
     
    Your error message says that the plant isn't invisible, it's just not there. You're interacting with an empty patch of land.

    Go to about line 383 and find this:
    -code-
    Oh, that makes sense. Also, the code worked. The berry system should be ready to roll now ^^
     
    Yikes! Apparently the game doesn't like me switching the berry system. The following error tends to pop up very often:
    Code:
    Script 'PokemonBerryPlants' line 333: NoMethodError occured.
    undefined method 'addUserAnimation' for nil: NilClass
    Seems like the line causing problems has something to do with the sparkle animation.
     
    This is an error regardless of type of berry system and should've been reported to the clean v15 bug thread whenever possible.

    In the clean version of Essentials v15, attempting to load a sparkling tree (which I assume is a fully grown one) via continuing or simply coming into the effected map from Kurt's map or a connecting map like Lappet Town will incur this error. (Not sure if addUserAnimation is meant to do this exactly.)

    You could simply comment out line 333 for the timing being.
     
    Last edited:
    Back
    Top