View Single Post
  #3    
Old March 27th, 2012 (04:05 PM).
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
Adding Eggs that can go to the PC is difficult. There's no easy method for it - you need to piece it together yourself:

Code:
species=PBSpecies::TOGEPI
dexdata=pbOpenDexData
pbDexDataOffset(dexdata,species,21)
eggsteps=dexdata.fgetw
dexdata.close
poke=PokeBattle_Pokemon.new(species,EGGINITIALLEVEL,$Trainer)
poke.calcstats
poke.name=_INTL("Egg")
poke.eggsteps=eggsteps
pbAddToPartySilent(poke)
You'll also need to include a message. The reason why pbAddToParty isn't used is because it gives the name of the Pokémon being added, which you don't want to show because it's an Egg and the player shouldn't know the species.

Frankly, you shouldn't have a situation where the game wants to give an Egg to the player when they have a full party. It's messy, and rather uncaring if you send an Egg straight off to storage.

To give the player an Egg when they have a free space in their party, simply use pbGenerateEgg(PBSpecies::TOGEPI). You'll still need to add in your own message. The Wiki has more information about Eggs (and about giving Pokémon too).
__________________
Reply With Quote