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

Egg and Species

Allgamesdude

The Creator of the WIP game, Pokémon Cosmic. Looki
  • 283
    Posts
    12
    Years
    Hi Just a quick question.

    How would I set an unhatched egg's species to a variable? Like I have a guy in my game, who gives the player a random egg. It can contain one of five pokémon: Gible, Aron, Larvitar, Mareep, or Ralts. I've set it up in such a way so that the variable is controlled randomly from 1 to 5, and there are conditional branches for egg giving within the conditional branches for the variable. I want to check the unhatched species name, and set it to a variable, so that, only when that pokémon has been hatched, he will say: Oh \PN! Glad you came back. How's that (insert hatched pokémon's species name here) I gave you? How would I do this?

    Pokegod7020
     
    Wow. That was a lot easier than I thought. Thanks!
     
    Part of the event command "Control Variables" allows you to set a variable to a random number. It's literally built into RMXP. No need for scripts for that.
     
    Well, I want to set a species name, not the number. How would that work?
     
    Use conditional branches. For instance, if the variable is 2 and 2 is equal to a Ralts egg, then when the player comes back, have a conditional branch test what the variable is equal to and if it is two, it will say it is a Ralts.
     
    and is there any possible way for the dude to say that only if the egg has hatched? Like I don't want somebody getting the egg, then the player talks to him right after, and learns what pokémon is in it right away.
     
    That, I don't know. That would probably require scrpting knowledge, because I don't think it's possible with events alone.
     
    Does anyone else know how? Or someway I can do it in a similar fashion?
     
    Does anyone else know how? Or someway I can do it in a similar fashion?

    You can either check the players party for the Pokemon or check if the player has a pokedex entry of the Pokemon.

    Just make sure the Pokemon you are giving can't be obtainable in another way cause otherwise that Pokemon could trigger the text too.
     
    That actually sounds pretty good! I'll do it that way. Also, if I do it that way, is there any way to make the other pokemon which were possible to obtain from the egg only, now can be found in the wild? For example, if the player got Gible, then gible wouldn't be able to be found in the wild, but Ralts, Mareep, Larvitar, and Aron would be.
     
    That actually sounds pretty good! I'll do it that way. Also, if I do it that way, is there any way to make the other pokemon which were possible to obtain from the egg only, now can be found in the wild? For example, if the player got Gible, then gible wouldn't be able to be found in the wild, but Ralts, Mareep, Larvitar, and Aron would be.

    Well you can use this to change encounters.
     
    Thats awesome! Thanks RM!
     
    Back
    Top