• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Random Egg Generator

v19 Random Egg Generator N/A

This resource pertains to version 19 of Pokémon Essentials.
Pokémon Essentials Version
v19.1 ➖
Quick, simple script that generates an egg that can hatch into any species in the PokeDex. (If you're needing the Galar mons, check out the Gen 8 Project)

Paste in a new script section above main:
Ruby:
RANDOMSTEPS = 10000

def pbGenerateRandEgg(text = "")
  return false if $Trainer.party_full?
  pool = []
  GameData::Species.each { |species| pool.push(species.id) if species.form == 0 }
  pkmn = pool[rand(0,pool.length)]
  pkmn = Pokemon.new(pkmn, Settings::EGG_LEVEL) if !pkmn.is_a?(Pokemon)
  # Set egg's details
  pkmn.name           = _INTL("Egg")
  pkmn.steps_to_hatch = RANDOMSTEPS
  pkmn.obtain_text    = text
  pkmn.calc_stats
  # Add egg to party
  $Trainer.party[$Trainer.party.length] = pkmn
  return true
end

The value RANDOMSTEPS at the top sets the number of steps for the egg to hatch. (It's 10,000 steps here, but you can easily change it to whatever you'd like)

Just like when giving a regular egg, you'll use it in a conditional branch to add it to the player's party. The only change is that now you only set the text, rather than setting the species.
1629324741438.png



FAQ

Q: It's not as fun to hatch a bunch of Pokemon instead of exploring new locations to find them!

A: But you get to obtain all the Pokemon. Isn't that more important than fun gameplay?

Q: There's no lore or anything to the legendaries, they're just handed to me by an NPC!

A: But you get to obtain all the Pokemon. Isn't that more important than story and lore?

Q: It's so tedious to hatch these eggs, and it'll take forever to get the Pokemon I want if it's randomized like this!

A: But you can obtain all Pokemon. Isn't that the most important thing about Pokemon games?



For a more genuine resource like this, check out ThatWelshOne_'s Random Pokemon Selector or Luka SJ's Randomizer X.
Credits
Code is adapted from Luka SJ's Randomizer, so credit goes to him!
Author
TechSkylander1518
Views
3,106
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TechSkylander1518

Back
Top