• 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.

Error when wild encounters appearing

55
Posts
10
Years
    • Seen Oct 8, 2019
    Hey,

    I updated my game and now I can't face wild Pokemon anymore. When I am running in the gras and a Pokemon appears, the following message appears:

    Code:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: NoMethodError
    Message: undefined method `length' for nil:NilClass
    PScreen_Bag:722:in `pbQuantity'
    PField_Field:844:in `pbGenerateWildPokemon'
    PField_Field:892:in `pbWildBattle'
    PField_Field:1374:in `pbBattleOnStepTaken'
    PField_Field:1398:in `pbOnStepTaken'
    Game_Player:484:in `update_old'
    Walk_Run:76:in `update'
    Scene_Map:104:in `updateOldFL'
    Scene_Map:101:in `loop'
    Scene_Map:114:in `updateOldFL'
    
    This exception was logged in 
    C:\...\Saved Games/Pokemon Essentials/errorlog.txt.
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------
    Additonally when I start the game, before compiling this error message occurs (game compiles afterwards and starts):

    Code:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    [ArgumentError, "undefined class/module ControlConfig", ["Section050:1743:in `oldload'", 
    "Section050:1743:in `load'", "Section169:58:in `[m'", "Section169:54:in `open'", 
    "Section169:54:in `pbSetUpSystem'", "Section169:147"]]
    ---------------------------
    OK   
    ---------------------------
    I tried to create a Snagball that catches other trainers Pokemon (it works fine until I catch the Pokemon, than another error message occurs), I'm not sure if both problems are related to each other.

    This is the error log for the snagball (I named it shadowball):
    Code:
    ---------------------------
    Pokemon Essentials
    ---------------------------
    Exception: NoMethodError
    Message: undefined method `visible=' for nil:NilClass
    PScreen_Pokedex:667:in `pbChangeToDexEntry'
    PScreen_Pokedex:747:in `pbStartDexEntryScene'
    PScreen_Pokedex:1109:in `pbDexEntry'
    PokeBattle_Scene:2792:in `pbShowPokedex'
    PokeBattle_Scene:2789:in `pbFadeOutIn'
    PokeBattle_Scene:2789:in `pbShowPokedex'
    PokeBattle_Battle:236:in `pbThrowPokeBall'
    PItem_ItemEffects:1972
    PItem_ItemEffects:1971:in `call'
    Event:150:in `trigger'
    
    This exception was logged in 
    C:\...\Saved Games/Pokemon Essentials/errorlog.txt.
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------
    Can anybody help me to fix the problem? I'd appreciate an answer very much!!!

    Cheers Hargatio
     
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    Try forcibly removing your save file, because your first couple problems seem to be related to something royally screwed up in whatever you're attempting to use as a save file. (How can your bag have no pockets??!)

    EDIT: for your snagball error: I think you may be missing a couple of lines from pbStartDexEntryScene (in PScreen_Pokedex), because in my copy of the section the call to pbChangeToDexEntry should be taking place on line 749, not 747... And the assignment to @sprites["entryicon"] should be taking place on line 748... If it's not there, then your problem will appear. (This is my speculating, seeing as I don't have your code to look at, but regardless, you should double check that your code isn't missing things.)

    Code:
      def pbStartDexEntryScene(species)     # Used only when capturing a new species
        @dummypokemon=PokeBattle_Pokemon.new(species,1)
        @sprites={}
        @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport.z=99999
        @sprites["dexentry"]=IconSprite.new(0,0,@viewport)
        @sprites["dexentry"].setBitmap(_INTL("Graphics/Pictures/pokedexentry"))
        @sprites["dexentry"].visible=false
        @sprites["overlay"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
        pbSetSystemFont(@sprites["overlay"].bitmap)
        @sprites["overlay"].x=0
        @sprites["overlay"].y=0
        @sprites["overlay"].visible=false
        @sprites["entryicon"]=PokemonSprite.new(@viewport)
        pbChangeToDexEntry(species)
        pbDrawImagePositions(@sprites["overlay"].bitmap,[["Graphics/Pictures/pokedexBlank",0,0,0,0,-1,-1]])
        pbFadeInAndShow(@sprites)
      end
     
    Last edited:
    55
    Posts
    10
    Years
    • Seen Oct 8, 2019
    Okay thank you very much, tustin!!!

    I really messed it up when creating the snagball. I deleted the savegame and checked the lines at pbStartDexEntryScene (in PScreen_Pokedex) and some lines were accidentely deleted. I fixed that and everything is fine now.

    To your question with the pockets. I deleted the mail pocket, but forgot to change a couple of lines as well, thats probably why this error occured. It's fixed now.

    I have another question regarding the snagball.
    In script section "PItems_Pokeballs" the advice is to add this code:
    Code:
    BallHandlers::OnCatch.add(:SHADOWBALL,proc{|ball,battle,pokemon|
       pokemon.makeShadow
    })
    The catch rate seems to me like a normal Pokeball. To increase the catch rate (e.g. like a Ultraball) can I use the following function instead?

    Code:
    BallHandlers::ModifyCatchRate.add(:SHADOWBALL,proc{|ball,catchRate,battle,battler|
       next (catchRate*2).floor
    })
    It's a copy of the Ultraball, just replace the name to Shadowball.

    I don't want a shadow pokemon, just a ball that catches trainer's pokemon with a good chance. But I'm not sure if it has any effect on the game when I don't add the proper code given in the advice. I tried the new code and it worked so far...

    EDIT:
    If the function should work, is it possible then to increase a catchrate higher than an Ultraball or is there a limit?
    for example a SuperUltraball:
    Code:
    BallHandlers::ModifyCatchRate.add(:SUPERULTRABALL,proc{|ball,catchRate,battle,battler|
       next ([B]catchRate*[COLOR=DarkRed]4[/COLOR][/B]).floor
    })
     
    Last edited:
    129
    Posts
    8
    Years
    • Seen Mar 23, 2023
    It's your game, you can do whatever you want with your new ball type. Experiment a little and see what works. You're certainly not limited to only one kind of handler per ball or anything.
     
    Back
    Top