Forms and Pokemon-specific egg sprites

Keileon

Sardonyx's Kyuubi
Member
Joined
Jun 28, 2017
Posts
84
Age
26
So my game uses Pokemon-specific eggs and for the most part they seem to work fine... when the filename is just something like 058egg.png.

However, if the egg has a form applied to it, it seems to use the base egg even if the form is set to 1.

This is the base egg sprite, with the filename 058egg.png:



This is the sprite I want to use for when Growlithe's form is set to 1, and I've used both 058egg_1.png (the format that I got the egg files in, so I assumed it would work) and 058_1egg.png (which seemed the only other intuitive way to go about it):



With both filenames attempted, it always seems to default to this:


Hatching the egg shows that it's definitely set to form 1.


Any ideas why the form isn't translating to the egg?


Edit: I've been told that egg sprites don't differentiate between forms, so is there a way to make them do so?


Edit 2: Potentially solved in Discord.
 
Last edited:

Lord X-Giga-X

Sardonyx's Reaper
Member
Joined
Jun 28, 2017
Posts
46
(co-developer with Keileon) (also ignore if you're using v17)
It was... a very weird process figuring this out... The main thing of course was that it worked.

This requires editing sections with the script section PSystem_Utilities. In our case though, we had a separate script altering the necessary script sections needed for another function of our game. So it was more convenient to edit that script.
Though since that's just for our game, what I'd suggest doing to replicate what I've done is to do the following:

In PSystem_Utilities, go to around line 1095 to find the following lines:
Code:
 if pokemon.isEgg?
	bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
	if !pbResolveBitmap(bitmapFileName)
	  bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
	  if !pbResolveBitmap(bitmapFileName)
		bitmapFileName=sprintf("Graphics/Battlers/egg")
	  end
	end
Replace that with the following:
Code:
  if pokemon.isEgg?
	form=nil
	form=(pokemon.form rescue 0)
	tform=((form && form>0) ? "_#{form}" : "")
	bitmapFileName=sprintf("Graphics/Battlers/%segg%s",
		getConstantName(PBSpecies,species),tform) rescue nil
	if !pbResolveBitmap(bitmapFileName)
	  bitmapFileName=sprintf("Graphics/Battlers/%03degg%s",species,tform)
	  if !pbResolveBitmap(bitmapFileName)
		bitmapFileName=sprintf("Graphics/Battlers/egg")
	  end
	end

Next go to line 1130 to find the following lines:
Code:
  if egg
  bitmapFileName=sprintf("Graphics/Battlers/%segg",getConstantName(PBSpecies,species)) rescue nil
  if !pbResolveBitmap(bitmapFileName)
	  bitmapFileName=sprintf("Graphics/Battlers/%03degg",species)
	  if !pbResolveBitmap(bitmapFileName)
		bitmapFileName=sprintf("Graphics/Battlers/egg")
	  end
  end
Replace that with the following:
Code:
  if egg
	tform=((form && form>0) ? "_#{form}" : "")
	bitmapFileName=sprintf("Graphics/Battlers/%segg%s",getConstantName(PBSpecies,species),
	  tform) rescue nil
	if !pbResolveBitmap(bitmapFileName)
	  bitmapFileName=sprintf("Graphics/Battlers/%03degg%s",species,tform)
	  if !pbResolveBitmap(bitmapFileName)
		bitmapFileName=sprintf("Graphics/Battlers/egg")
	  end
	end
Also, adjust weird spacing that I'm too lazy to get rid of atm.

There's also icons to deal with in this regard at line 1213. Though as is, we aren't really worrying about egg icons in general, so I have nothing on that end.
I'm also not entirely sure if this is what Maruno had in mind when he gave us advice on how to do this, but it works, so... yeah...
Thanks for the help either way, Maruno.


EDIT: Sorry about that, I accidentally copy/pasted a set of original lines twice.
EDIT2: Made one more edit after we noticed a bug.
 
Last edited:
Top