• 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] I really don't know...

#Not Important

All hail the wishmaker
910
Posts
4
Years
  • ---------------------------
    Pokemon Meteor
    ---------------------------
    [Pokémon Essentials version 17.2]

    [II POKEMON METEOR II]

    Exception: NoMethodError

    Message: undefined method `each' for 0:Fixnum

    Pokemon_ShadowPokemon:467

    Pokemon_ShadowPokemon:466:in `call'

    EventHandlers:54:in `trigger'

    EventHandlers:49:in `each'

    EventHandlers:49:in `trigger'

    Overworld Pokemon:270:in `pbOnStepTaken'

    Game_Player:465:in `update_old'

    Game_Player_Visuals:71:in `follow_update'

    PokemonFollow:1478:in `update'

    Scene_Map:164:in `follow_update'
    ---------------------------
    OK
    ---------------------------
    Help...
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    There's something on Pokemon_ShadowPokemon line 467 that should be an array (because .each is used on it), but it's a 0.
     

    #Not Important

    All hail the wishmaker
    910
    Posts
    4
    Years
  • There's something on Pokemon_ShadowPokemon line 467 that should be an array (because .each is used on it), but it's a 0.

    It's $Trainer.party...
    How does that work?
    Code:
    Events.onStepTaken+=proc{
      if ($Trainer.party==1 || $Trainer.party==2 || $Trainer.party==3 || $Trainer.party==4 || $Trainer.party==5 || $Trainer.party==6 )
         for pkmn in $Trainer.party
           if pkmn.hp>0 && !pkmn.egg? && pkmn.heartgauge>0
             pkmn.adjustHeart(-1)
             pbReadyToPurify(pkmn) if pkmn.heartgauge==0
           end
         end
         if ($PokemonGlobal.purifyChamber rescue nil)
           $PokemonGlobal.purifyChamber.update
         end
         for i in 0...2
           pkmn=$PokemonGlobal.daycare[i][0]
           next if !pkmn
           pkmn.adjustHeart(-1)
           pkmn.pbUpdateShadowMoves()
         end
      end
    }
    Would that fix it?
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Code:
    if ($Trainer.party==1 || $Trainer.party==2 || $Trainer.party==3 || $Trainer.party==4 || $Trainer.party==5 || $Trainer.party==6 )
    What is this line trying to do? I'd expect it to always fail, because party should be an array, so never equal to a number. Did you mean $Trainer.party.length==1?

    Anyway, I suspect your problem is that somewhere you wrote $Trainer.party=0 instead of $Trainer.party==0 and now your party is a zero. I hope you didn't save.
     

    #Not Important

    All hail the wishmaker
    910
    Posts
    4
    Years
  • Code:
    if ($Trainer.party==1 || $Trainer.party==2 || $Trainer.party==3 || $Trainer.party==4 || $Trainer.party==5 || $Trainer.party==6 )
    What is this line trying to do? I'd expect it to always fail, because party should be an array, so never equal to a number. Did you mean $Trainer.party.length==1?

    Anyway, I suspect your problem is that somewhere you wrote $Trainer.party=0 instead of $Trainer.party==0 and now your party is a zero. I hope you didn't save.

    I wanted to give the player Jirachi to help them escape from a cellar or such then remove that, so yeah. I did write $Trainer.party=0 but on purpose.
    And now, on the loading screen I need to make sure that if there is no pokemon it shows icon000

    ive done this so far:
    Code:
      def pbSetParty(trainer)
        return if !trainer || !trainer.party
        meta = pbGetMetadata(0,MetadataPlayerA+trainer.metaID)
        if meta
          filename = pbGetPlayerCharset(meta,1,trainer)
          @sprites["player"] = TrainerWalkingCharSprite.new(filename,@viewport)
          charwidth  = @sprites["player"].bitmap.width
          charheight = @sprites["player"].bitmap.height
          @sprites["player"].x        = 56*2-charwidth/8
          @sprites["player"].y        = 56*2-charheight/8
          @sprites["player"].src_rect = Rect.new(0,0,charwidth/4,charheight/4)
        end
        for i in 0...trainer.party.length
          if !(trainer.party[i])
            @sprites["party#{i}"] = PokemonIconSprite.new(trainer.party[i],@viewport)
            @sprites["party#{i}"].x = 151*2+33*2*(i&1)
            @sprites["party#{i}"].y = 36*2+25*2*(i/2)
            @sprites["party#{i}"].z = 99999
          #-------------------------------------------------------------------------
          else
            @sprites["party#{i}"] = PokemonIconSprite.new(icon000,@viewport)
            @sprites["party#{i}"].x = 151*2+33*2*(i&1)
            @sprites["party#{i}"].y = 36*2+25*2*(i/2)
            @sprites["party#{i}"].z = 99999
          end
        end
      end
    it fails. :(
     

    #Not Important

    All hail the wishmaker
    910
    Posts
    4
    Years
  • Code:
    if ($Trainer.party==1 || $Trainer.party==2 || $Trainer.party==3 || $Trainer.party==4 || $Trainer.party==5 || $Trainer.party==6 )
    What is this line trying to do? I'd expect it to always fail, because party should be an array, so never equal to a number. Did you mean $Trainer.party.length==1?

    Anyway, I suspect your problem is that somewhere you wrote $Trainer.party=0 instead of $Trainer.party==0 and now your party is a zero. I hope you didn't save.

    Anyway...
    Im probably not gonna use shadow pokemon anyway...
     
    Back
    Top