• 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?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • 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.

Crashing issue related to PokemonField

Derxwna Kapsyla

Derxwna "The Badman" Kapsyla
  • 437
    Posts
    13
    Years
    So, for the past few months, I've been receiving an odd bug report for my game. One that I just can't figure out the issue for. I've effectively started calling it the Route 11 Bug, since the only time I've received the issue is in regards to my Kanto Route 11. The Route 11 Bug seems to affect save files on load, and makes them corrupted and unplayable. Between the three reports I've gotten, there were only a few things in common.
    • Firstly, that the bug occured on Route 11
    • Secondly, that the bug involved loading the game
    • and Thirdly, the error report itself
    The first time I got the report was with an ask to my Tumblr in regards to it.
    Dear Derxwna Kapsyla
    I have recently experience a strange error that has not occurred to anyone prior to this point. When I try to load on Route 11 (I have saved and loaded from there successfully before), I get the error message Script 'PokemonField' line 1593: NoMethodError occurred. undefined method spriteset for #scene_intro:<0x28e4558>. What in the world is going on?

    When I had mentioned that I had no idea of the bug initially and asked them to give me more information about what happened, I was told this.
    Dear Derxwna Kapsyla
    It's me, the user with the strange unknown error. I can't even load the save file anymore. I was just leveling up on Route 11, leveling up my Merlin. I had to head off so I could take care of something, so I saved right next to a patch of grass (could it be a void?). Then I closed the window, and when I came back and opened the game window again, the game would spit that error out when the save was just about loaded.
    So from that I've deduced it was an issue with something on save/load and ultimately I just couldn't reproduce it on this information. A week later, someone else stepped forward with the same issue. I asked for a detailed report, and I couldn't really find similarities (aside from the aforementioned three) that could cause it. I kinda forgot about it until last week, which is when the third person reported it. Same procedure, same results. Nothing I could directly tie together. But I figure three reports should hopefully be enough to deduce an issue if I brought it here. I've started asking people who do get the bug to send me the corrupted save file so I could try and examine it, however futile it may be.

    All issues relating to the bug can be found on my development blog or on my personal blog. For further convenience, here is an image of the full map. This pastebin file also is where the error report says the script is associated with. For further mentioning, before someone asks, I am using a modified version of Essentials V14. (Upgrading isn't really possible, so unless the bug is fixed that way I really don't want suggestions to update).

    Hopefully this all will help in resolving this quite vexing issue.
     
    Have you asked for one of the save files so you can see if you can get the error from that?

    Random question: Does Route 11 have any NPCs that walk around in the grass?
     
    I have asked people for the save file so I can try and examine them, yes. Unfortunately, nobody has sent me one I can look at yet, so I'm waiting on that.

    And yes, there is an NPC that does walk around in the grass, two of them actually.
    [PokeCommunity.com] Crashing issue related to PokemonField
    [PokeCommunity.com] Crashing issue related to PokemonField
     
    Someone finally sent me their save file, and I've managed to figure out two things.
    • First and foremost, the issue only shows up on loading the game in Demo 6 of my game. If I load it in Demo 7, it's fixed. Normally, this'd be a non-issue because "hey it's fixed, no more reason to be concerned!" except this bug still makes saves unplayable, so I need to know whats wrong so I can patch it up and release a quick fix to players. Otherwise I have everyone send me their saves and I fix it manually, which is less-than-ideal.
    • Secondly, I now have the full error report.
    [PokeCommunity.com] Crashing issue related to PokemonField


    Hopefully this should gleam more light on the situation at hand. I've already checked and confirmed, the version of Essentials being used between Released Demo 6-2 and Unreleased Demo 7 is Essentials v14, so the issue isn't the base Essentials version (Or it could be, just with the script edits I did fixing it.)
     
    So, I've looked into it, and all the changes I've done since Demo 6's release and Demo 7's progress, and all I could find was one small change which could have fixed it. Specifically, it was this script made by KleinStudio. So I set about checking if that was the case by adding it to Demo 6, where I did confirm the bug. Adding it in made the save file loadable once more. I don't know if I'll need any further testing, but this might resolve the issue of the Route 11 Bug.
     
    UPDATES REGARDING BUG: So I had someone who had the bug download and test it, but they said they still had it. so I got further gritty with files and eventually fund what may be the fix I need? Apparently a system.rxdata from a working build, when placed in the broken build, makes it work. From my knowledge system.rxdata only controls script and variable names, as well as other "unimportant information". I'm going to see if I can send the file off to them for testing before that, but what I'd like to know now is - is it even possible that system.rxdata could be the fix? If all it contains is switches and variable names, how could that fix it?
     
    I believe this error is caused when saving the game while one of the moving NPCs was on-screen, and the NPC was walking in grass and causing the rustling animation. Upon loading, the map is updated once before the scene is set, and the NPC must have been at the exact point in its movement that it makes the animation in that update frame - it therefore tries to play the animation at that time (via $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true)) before $scene is set to be the map (it's still Scene_Intro at this point, which doesn't have the def spriteset in it, hence the error).

    My solution would be to add the following red lines:

    Code:
    Events.onStepTakenFieldMovement+=proc{|sender,e|
      event=e[0] # Get the event affected by field movement
      [COLOR=Red]if $scene.is_a?(Scene_Map)[/COLOR]
        currentTag=pbGetTerrainTag(event)
        if pbGetTerrainTag(event,true)==PBTerrain::Grass  # Won't show if under bridge
          $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true)
        elsif event==$game_player && currentTag==PBTerrain::WaterfallCrest
          # Descend waterfall, but only if this event is the player
          Kernel.pbDescendWaterfall(event)
        elsif event==$game_player && PBTerrain.isIce?(currentTag) && !$PokemonGlobal.sliding
          Kernel.pbSlideOnIce(event)
        end
      [COLOR=Red]end[/COLOR]
    }
    If I'm right, the save files should be usable - there's nothing wrong with them, it's just that there's a crack in the scripts for this rare case.

    As far as the supposedly broken save files working intermittently, I don't know why. Maybe it's an inaccuracy in rounding values when calculating the NPC movements.
     
    Last edited:
    I applied your changes, and I got this error report
    [PokeCommunity.com] Crashing issue related to PokemonField

    Code:
    ---------------------------
    Touhoumon Faith & Prayer Version 1.8
    ---------------------------
    Exception: NoMethodError
    
    Message: undefined method `isJustGrass?' for PBTerrain:Class
    
    PokemonField:1593
    
    PokemonField:1589:in `call'
    
    PBEvent:54:in `trigger'
    
    PBEvent:49:in `each'
    
    PBEvent:49:in `trigger'
    
    Game_Character_2:67:in `update_move'
    
    Game_Character_2:6:in `update_old2'
    
    Walk_Run:96:in `update'
    
    Game_Event_:252:in `update'
    
    Game_Map_:440:in `update'
    
    
    
    This exception was logged in 
    
    C:\Users\Andrew\Saved Games/Touhoumon Faith _ Prayer Version 1_8/errorlog.txt.
    
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------
     
    Ah, sorry, that's from the upcoming version of Essentials. I fixed that. But I didn't say to touch that line at all - I just said to add the two red ones. Why aren't you following instructions?
     
    Clean indentations in the code, your code looked better indented than the code I had. I know it doesn't matter since code doesn't need to be indented at all, but I felt weird looking at the indentations. I did initially copy the two red lines only, but yeah. Not sure why I didn't think to just... indent it manually, but what's done is done I guess.
    It should be working fine now, as the game actually loaded up and ran.
     
    Back
    Top