- 24
- Posts
- 9
- Years
- Seen Jan 18, 2023
For my own game, I needed to make some eggs hatch immediately. After looking around I found two different scripts, and neither of them worked... so I made my own. My very FIRST script ever! It may not help people who are good at scripting, but I'm sure some other newbies can make some use of it.
First Time Scripter Walkthrough:
To use this, what I did was insert a new script by going to Tools > Script Editor. I right clicked "Main" and Inserted a new Script above it. I named it Hatching, because I'm lazy, but you can name it whatever helps you find it later.
In the new Script, copy and paste the following:
Now, in the event that you want to add the Instant Hatching to, you go to the event, add a Script, and paste this:
pbFastHatch
Simple as that! I should mention that this script only hatches the Egg if it's the last in your party, so this script is only particularly useful if used right after the 'Generate Egg' script. And since it should be used directly after the event gives you the egg, you can change a number of things about the egg using this script =) Here's some examples:
I've tested these all, and they work just fine =D You can further edit the Pokemon any way you want by checking out this page: "https://pokemonessentials.wikia.com/wiki/Editing_a_Pok%C3%A9mon" and switching out poke. for egg. =) You can also put several of these instances in the same sheet by pasting it again and changing the 'def' section. For example:
"def pbFastHatch"
Could bring you a level five Pokemon, completely randomized.
While "def pbFastHatchShiny"
Could have the egg.makeshiny script. You'd call upon it instead of pbFastHatch and you'd get a level 1 Shiny Pokemon.
And to make things more interesting, for those who don't know, you can still use this method when adding an egg without having it hatch immediately! All you have to do is remove 'pbHatch (egg)' and the egg will hatch in the normal amount of steps, but still have everything you set for it. (natures, levels, what have you)
Finally, if anyone knows how to make it so that the script can hatch ALL eggs (because I know someone will need that) please let me know! I'm still a beginner myself!
First Time Scripter Walkthrough:
To use this, what I did was insert a new script by going to Tools > Script Editor. I right clicked "Main" and Inserted a new Script above it. I named it Hatching, because I'm lazy, but you can name it whatever helps you find it later.
In the new Script, copy and paste the following:
Code:
def pbFastHatch
egg=$Trainer.lastParty
if egg.isEgg?
egg.eggsteps=0
pbHatch(egg)
end
end
pbFastHatch
Simple as that! I should mention that this script only hatches the Egg if it's the last in your party, so this script is only particularly useful if used right after the 'Generate Egg' script. And since it should be used directly after the event gives you the egg, you can change a number of things about the egg using this script =) Here's some examples:
Spoiler:
Code:
# This one makes the Egg hatch at Level 5 (good for Starters!)
def pbFastHatch
egg=$Trainer.lastParty
if egg.isEgg?
egg.eggsteps=0
egg.level=5
pbHatch(egg)
end
end
# This one makes the egg that hatches 100% Shiny!
def pbFastHatch
egg=$Trainer.lastParty
if egg.isEgg?
egg.eggsteps=0
egg.makeshiny
pbHatch(egg)
end
end
# This gives you a level 5 male Pokemon with Bashful nature!
def pbFastHatch
egg=$Trainer.lastParty
if egg.isEgg?
egg.eggsteps=0
egg.level=5
egg.makeMale
egg.setNature (:BASHFUL)
pbHatch(egg)
end
end
I've tested these all, and they work just fine =D You can further edit the Pokemon any way you want by checking out this page: "https://pokemonessentials.wikia.com/wiki/Editing_a_Pok%C3%A9mon" and switching out poke. for egg. =) You can also put several of these instances in the same sheet by pasting it again and changing the 'def' section. For example:
"def pbFastHatch"
Could bring you a level five Pokemon, completely randomized.
While "def pbFastHatchShiny"
Could have the egg.makeshiny script. You'd call upon it instead of pbFastHatch and you'd get a level 1 Shiny Pokemon.
And to make things more interesting, for those who don't know, you can still use this method when adding an egg without having it hatch immediately! All you have to do is remove 'pbHatch (egg)' and the egg will hatch in the normal amount of steps, but still have everything you set for it. (natures, levels, what have you)
Finally, if anyone knows how to make it so that the script can hatch ALL eggs (because I know someone will need that) please let me know! I'm still a beginner myself!
Last edited: