• 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.

Random Pokémon selector (v19)

  • 124
    Posts
    4
    Years
    Another small, yet fun, script from me. This time, a means of giving the player a random Pokémon, mainly created with the starter selection event in mind, but it can work whenever the player is given a gift Pokémon. I thought it might be fun for the player to have a fourth, random option when picking their starter!

    Features
    • As customisable as you want to make it.
    • Specify "white list" of Pokémon from which to choose.
    • Specify "black list" of Pokémon to be excluded. I've included an option for a default black list that contains all legendary/mythical Pokémon.
    • Option to select only unevolved Pokémon.
    • Choose which generation from which a Pokémon is drawn.

    Installation
    1. Download the .zip file from this MediaFire link.
    2. Once downloaded, open the .zip file.
    3. Drag the folder you see into your project's main folder (where you have Game.exe), allowing it to merge with your existing Plugins folder. And that's it!

    How to use
    The most basic way to use this script is to simply call pbChooseRandomPokemon, for example:
    Code:
    pkmn = pbChooseRandomPokemon
    pbAddPokemon(pkmn, 5)

    The first line returns the symbolic name of a randomly selected unevolved Pokémon from generations 1-8 (including legendary/mythical Pokémon). The second line gives the player this Pokémon at level 5.

    The first line in the block of code above is equivalent to the block of code pasted below.
    Code:
    pkmn = pbChooseRandomPokemon(
    whiteList=nil,
    blackList=nil,
    addList=nil,
    base_only=true,
    use_gen=nil)

    Each option is explained as follows:

    • whiteList should be nil or an array of species names, for example [:BULBASAUR,:CHARMANDER,:SQUIRTLE]. This option allows you to restrict what species can be selected. If nil, all species not on the black list are fair game.
    • blackList should be nil, "suggested" or an array of species names. This option allows you to exclude certain species from the random selection. If nil, nothing is excluded. If "suggested", all legendary/mythical Pokémon will be excluded. Note: the black list trumps the white list.
    • addList is a second black list and mainly exists for when you want blackList="suggested" AND you want other species to be excluded. This option should be nil or an array of species names, as above.
    • base_only should be true or false. This option allows you to restrict the random selection to unevolved Pokémon (true) or any Pokémon (false). If this option is true and you have evolved Pokémon in your whiteList option, they will be ignored.
    • use_gen should be nil or an array of numbers from 1 to 8 (inclusive). This option restricts the random selection to species from the corresponding generations. If nil, Pokémon from all generations are included. Important! Even if you only want Pokémon from a single generation, you should still set this option as an array, for example use_gen=[5] to draw from Unovan Pokémon. You would do use_gen=[1,2] if you want Pokémon from Kanto and Johto, as another example. Note: whiteList trumps this option.

    I appreciate that that wall of text might only make sense to me, so please do ask questions below or contact me via Discord (ThatWelshOne_#3324). I'm always happy to help where I can.

    I'm also happy to receive feedback and suggestions if you have any.

    As always, thanks for reading!
     
    Last edited:
    Back
    Top