• 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!
  • Akari, Selene, Mint, Solana - 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.

Methods for finding party pkmn

  • 132
    Posts
    10
    Years
    I'm trying to customize an egg, but I get a crash produced by the method $Trainer.lastParty.
    Spoiler:

    The crash report:
    Spoiler:

    I recall other methods, like $Trainer.party[0], giving me grief, but I'm not sure why. I'd appreciate any help.
     
    you need to have all those scripts in a single script

    This.

    Instead of what you've got there, try this:
    make a new function in the scripts, not an event, with this code:
    Code:
    def shayminEgg?
      if Kernel.pbGenerateEgg(:SHAYMIN)
        egg=$Trainer.lastParty
        egg.level=25
        egg.calcStats
        return true
      else
        return false
      end
    end

    Now, just just "shayminEgg?" as the code in your conditional branch, and the only thing to happen inside the "true" branch is setting the self switch A to on.
     
    Note that the lastParty method was added in Essentials v15. If you're using an older version of Essentials, you won't have it and it won't work. Use egg=$Trainer.party.last instead.

    you need to have all those scripts in a single script
    Actually, you don't. So long as there's nothing between them (like a comment), you can have multiple separate script commands and they'll all behave as one when run.
     
    Back
    Top