• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Custom Feature Question] Variable to display a random Pokemon name?

Natzen

Creator of Pokémon: Sanguine
  • 49
    Posts
    9
    Years
    Code:
    $game_variables[125]=rand(149)+1
    pkmn=pbGetPokemon(125)
    pbSet(126,pkmn.name)

    I'm sure there's plenty of faulty logic in what I'm trying to figure out.

    Basically I'm trying to work a system where a player can use a telescope, stores a random number in variable 125 (in this example, between 1-149, vanilla kanto dex), sets pkmn equal to whatever value 125 is equal to.
    Then whatever pkmn is, get .name and store in variable 126.

    Theoretically I want to call variable 126 in a game message to say something like,

    Woah - you see a \v[126] off in the distance
    "Woah - you see a Dragonite off in the distance".

    In the future I would probably like to only select from a certain list of mon, probably through a var.shuffle, then send them off to that map for a fateful encounter with the respective pokemon, upon defeat/capture resetting the variables of the [mini-game].

    Anyways for now I'm just trying to figure out why I can't pull pokemon names from a variable, I'm pretty much using the same code found in the example where an npc tells you what pokemon is in your party. I just replaced the variables 1 and 2 with my own (125 - where the pokemon id is stored and 126 - where i want to store the name).

    Code:
    pkmn=pbGetPokemon(125)
    pbSet(126,pkmn.name)
     
    Last edited:
    [PokeCommunity.com] Variable to display a random Pokemon name?


    Just bumping post - thanks to anybody who can help 😜🖤​
     
    Back
    Top