• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
11
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
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    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.
     
    378
    Posts
    11
    Years
    • Seen Oct 18, 2017
    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.
     

    Allgamesdude

    The Creator of the WIP game, Pokémon Cosmic. Looki
    283
    Posts
    11
    Years
  • 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.
     
    378
    Posts
    11
    Years
    • Seen Oct 18, 2017
    That, I don't know. That would probably require scrpting knowledge, because I don't think it's possible with events alone.
     
    1,405
    Posts
    11
    Years
  • 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.
     

    Allgamesdude

    The Creator of the WIP game, Pokémon Cosmic. Looki
    283
    Posts
    11
    Years
  • 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.
     
    1,405
    Posts
    11
    Years
  • 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.
     
    Back
    Top