- 91
- Posts
- 14
- Years
- Seen Sep 5, 2015
What's the script to check for the species of an Egg? I tried the following:
"pbHasSpecies?(:SPECIES)" would do the trick, but Eggs are not considered as species when not born.
"$Trainer.party[0].egg?" only returns whether that Pokemon is an Egg or not, but doesn't check species.
"pbHasEgg?(:SPECIES)" simply returns true if the species targetted can breed or be bred.
Im doing a Game Corner Egg Store with coins. I want the player to be able to choose a "Mysterious Egg" among other species. When choosing the Mysterious Egg (which is simply a Caterpie) then I want to check for the Species (so it's not any of the other possible species) so if it IS Caterpie, then I change its species, change moves, make shiny, change steps...
I can already purchase eggs with no problem, but the problem comes in checking the egg bought in order to change it if it's the special one.
Script looks like this:
Choose script:
Purchase script:
The code for the Conditional Branch:
Then of course check if the party is full etc. That part is working well so no problem with that.
I know I should be looking at the code in the purchase script (pbSet) as it's storing the species into a variable, but when using $game_variables[1]=:CATERPIE the conditional branch is completely ignored (doesn't even go to Else).
Clueless. Hope someone with more knowledge can help me learn.
"pbHasSpecies?(:SPECIES)" would do the trick, but Eggs are not considered as species when not born.
"$Trainer.party[0].egg?" only returns whether that Pokemon is an Egg or not, but doesn't check species.
"pbHasEgg?(:SPECIES)" simply returns true if the species targetted can breed or be bred.
Im doing a Game Corner Egg Store with coins. I want the player to be able to choose a "Mysterious Egg" among other species. When choosing the Mysterious Egg (which is simply a Caterpie) then I want to check for the Species (so it's not any of the other possible species) so if it IS Caterpie, then I change its species, change moves, make shiny, change steps...
I can already purchase eggs with no problem, but the problem comes in checking the egg bought in order to change it if it's the special one.
Script looks like this:
Spoiler:
Choose script:
Code:
\CNblabla choose egg\ch[1,6,
BULBASAUR 30 PB,CHARMANDER 30 PB,
SQUIRTLE 30 PB, MEOWTH 15 PB,
MYSTERYEGG 30 PB, No thanks]
Purchase script:
Code:
item=[:BULBASAUR,:CHARMANDER,
:SQUIRTLE,:MEOWTH,
:CATERPIE,0][pbGet(1)]
price=[30,30,30,15,20,
0][pbGet(1)]
lv=[9,8,18,25,26,0][pbGet(1)]
if item && item!=0
item=getID(PBSpecies,item)
end
pbSet(1,item); pbSet(2,price)
pbSet(3,PBSpecies.getName(item))
pbSet(4,lv)
The code for the Conditional Branch:
Code:
Kernel.pbGenerateEgg(pbGet(1),_I("Egg Giver name"))
Then of course check if the party is full etc. That part is working well so no problem with that.
I know I should be looking at the code in the purchase script (pbSet) as it's storing the species into a variable, but when using $game_variables[1]=:CATERPIE the conditional branch is completely ignored (doesn't even go to Else).
Clueless. Hope someone with more knowledge can help me learn.
Last edited: