• 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!
  • 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,805
    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