• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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.

[Essentials Tutorial] How to generate a random wild pokemon

  • 1,799
    Posts
    8
    Years
    HEyo, ever wondered how to make a patch of grass generate a random wild pokemon?

    Look here!

    It's really simple, actually. Unfortunately you will have to define a new terrain tag and a new encounter for this to work (unless you want *all* of your grass or all of caves to generate any pokemon you have installed). If you're curious on how to work around this take a look at my old tutorial on making different types of grass here!

    Anywho, open your PBEncounter_Modifiers script

    Code:
    Events.onWildPokemonCreate+=proc {|sender,e|
       pokemon=e[0]
       if PBTerrain.isGlitchverse?(pbGetTerrainTag($game_player))
         pokemon.species=rand(821)
          pokemon.name=PBSpecies.getName(pokemon.species)
         newlevel=pbBalancedLevel($Trainer.party) - 4 + rand(5)   # For variety
         newlevel=1 if newlevel<1
         newlevel=PBExperience::MAXLEVEL if newlevel>PBExperience::MAXLEVEL
         pokemon.level=newlevel
         pokemon.calcStats
         pokemon.resetMoves
       end
    }

    and past that block! You may want to edit PBTerrain.isGlitchverse? and replace it with any method defined in PBTerrain and all encounters that generate on that terrain tag will be randomized! You'll still have to define the encounters as normal in your encounters.txt but it won't matter what you write; you can write Rattata,100, Palkia 100, Reshiram,100, Mewtwo_2,100 and it won't generate, but it will whine otherwise.
     
    Last edited:
    Back
    Top