Here is a script that will hatch all the eggs a player is holding at once, and charge for each of them separately. Handy if you're implementing breeding mechanics and have discovered that running round in straight lines actually does not count as fun gameplay!
This is a remarkably easy script to implement! Every single asm script required is already written in the rom. The script below is written for Emerald, but can be adapted to firered very easily.
Credit to redriders180 for the basic idea, back in 2013 in the quick r&d thread
Code:
'---------------
#dynamic 0xe70000 //DECIDE ON THIS YOURSELF, choose the pointer you want to start searching from
#org @delia //call whatever offset you put this in to activate the script
lockall
faceplayer
setvar 0x8007 0x0
setvar 0x8006 0x0
showmoney 0x0 0x0 0x0 // displays your player's dolla
msgbox @helloimtheegghatcher MSG_YESNO '"Hello! I'm Delia the Egg hatcher,\..."
compare LASTRESULT 0x1
if 0x1 goto @hatchloop // Always ask for consent before activating anyone's eggs
msgbox @oh MSG_KEEPOPEN
hidemoney 0x0 0x0
releaseall
end
#org @hatchloop
Copyvar 0x8004 0x8007//var 0x8004 (often known by its gamer tag of "lastresult") will be the input for special 149, which will look at the pokemon in the slot number given by this variable
special2 0x8005 0x149 //or 0x147 for frlg
compare 0x8005 0x19C
if 0x1 call @incubator // if it is an egg, we hatch it and charge the player, then we try for the next pokemon
addvar 0x8007 0x1
compare 0x8007 0x6
if 0x1 goto @finished //and we stop once we've tried all 6
goto @hatchloop
#org @incubator
checkmoney 0x3e8 0x0// ADJUST EGG COST HERE (in hexadecimal)
compare LASTRESULT 0x0
if 0x1 goto @nomoneyleft
special 0xC5 //or 0xc2 for frlg
waitstate
paymoney 0x3E8 0x0// ADJUST EGG COST HERE (in hexadecimal)
showmoney 0x0 0x0 0x0
setvar 0x8006 0x1
return
#org @finished
compare 0x8006 0x1
if 0x1 goto @hatchedegg
msgbox @youidiotwhydidyoutellmetohatcheggswhenyoudidntevenhaveany Msg_keepopen// tells you you have no eggs
hidemoney 0x0 0x0
releaseall
end
#org @nomoneyleft
msgbox @lolyourepoor MSG_KEEPOPEN// tells you you have run out of money but still have eggs
hidemoney 0x0 0x0
releaseall
end
#org @hatchedegg
msgbox @tada MSG_KEEPOPEN// congratulates you on becoming a father
hidemoney 0x0 0x0
releaseall
end
'---------
' Strings
'---------
#org @helloimtheegghatcher
= Hello! I'm Delia the Egg Hatcher,\nbut you can call me Eggs Dee!\pFor 1000[$] each, I can hatch your eggs!
#org @oh
= Oh. Some other time?
#org @lolyourepoor
= Oh! You haven't enough money\nto hatch all your eggs!
#org @youidiotwhydidyoutellmetohatcheggswhenyoudidntevenhaveany
= Oh[.] You don't have any eggs[.]
#org @tada
= All done! Take care of your new Pokémon!
__________________
Play Altered Emerald here!
Thanks to
DizzyEgg,
Lunos and the
EBEU team for the battle engine, features, dynamic expansion, and the mind-bogglingly excellent disassembly project, lu-ho for a-map,
Gamer2020 for pge, about 5 different hex editors, especially HexEdit which didn't suck, Microsoft Windows for Task Manager,
Chaos rush for sprites and an animation disable tutorial,
Spherical Ice for several excellent asm routines,
Neon Skylar for Pokemon data past gen 3, YAPE while it lasted, Scizz,
Knizz,
darthatron's numerous tools,
hackmew,
Chronosplit.
Altered Emerald is very old. Its final patch marks about 9 years since I started meddling with the Emerald rom. I won't forget it, but I think it makes sense to call it a wrap. This game is in a good state, with only difficult and mundane bugs remaining. Any further changes to Pokémon are left as an exercise to the reader.
After all, you have the roms.ini files, and Gamer2020's PGE, and access to the full force of the disassembly's documentation. Go screw up my game for me? Or better yet, steal my ideas, and make them your own?
Thanks for all the years. I am still blown away by the response this got.
And cut!