• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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
    5
    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...
     
    There's something on Pokemon_ShadowPokemon line 467 that should be an array (because .each is used on it), but it's a 0.
     
    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?
     
    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.
     
    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. :(
     
    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