v21.1 Game throws error when Trying to Hatch Egg

This thread pertains to v21.1 of Pokémon Essentials.

Tearsforlu

Rookie
Member
Joined
Nov 7, 2023
Posts
6
Age
30
Okay, I've tried everything to figure out what went wrong but I'm entirely stumped. I am rather new at this, so I might be missing something very obvious.

When I try to hatch an egg, I get this error:

what.png

Here's what happened before that:
I was making an event where you can pick up an egg that will contain a random pokemon that inhabits the area. I did this using this plugin, which I have used since I started making my fangame without any issue. It worked perfectly, I got an egg, and then I used debug to try and hatch it. It hatched just fine, but since I am using SimpleHUD,I noticed that I could see which pokemon had hatched like, a frame before the hatching egg animation popped up, which I did not want because I like the surprise of the egg.

So to fix this, I searched around until I figured out where the egg hatching scene happens, and tried to turn off the HUD using the switch I had assigned to it in the script of UI_EggHatching. I'm rather new to this so I didnt really know where to put it so I just tried putting it somewhere that seemed sensible to me. I save the script and close it, and then this error starts happening. Ok, I think, I'll just remove the bits I added in and it should work again. Nope. The error still happens after I removed what I added. I start thinking I must have accidentally touched something else, so I downloaded a fresh Pokemon Essentials and I copied the UI_EggHatching script from the fresh copy and overwrote the old one.

Still get this error. Here are some other things I tried:
-Copying the egg animation file and putting it in Graphics\Battlers (as indicated at the top of the UI_EggHatching script)
-Copying the egg animation file and putting it in Graphics\Battlers\eggCracks (as indicated at the top of the UI_EggHatching script)
- Doing the above and renaming the file to "eggcracks" "egg_cracks","egg_cracks_sprite_filename"
-Copying the egg animation file and leaving it where it is (Pokemon\eggs) but renaming it to the above

I am really stumped, I feel like all I did was touch it and it blew up lol. I did not install any new plugins before this happened, and like I mentioned above, the only thing I changed between the eggs hatching perfectly fine and then throwing this error was i attempted to flip a switch and then removed what I added.
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
270
Age
29
The problem isn't the animation graphics. The error says the "egg_cracks_sprite_filename" method for GameData::Species doesn't exist, which is odd because it definitely exists in the base Essentials.

Using CTRL+SHIFT+F, search the Script editor for egg_cracks_sprite_filename. Does it still appear in Species_files, line 60?
1700273545311.png
 

Tearsforlu

Rookie
Member
Joined
Nov 7, 2023
Posts
6
Age
30
The problem isn't the animation graphics. The error says the "egg_cracks_sprite_filename" method for GameData::Species doesn't exist, which is odd because it definitely exists in the base Essentials.

Using CTRL+SHIFT+F, search the Script editor for egg_cracks_sprite_filename. Does it still appear in Species_files, line 60?
View attachment 22688
I just checked, and it, for some reason, looks like this instead:

Ruby:
    def self._cracks_sprite_filename(species, form)
      ret = self.check_egg_graphic_file("Graphics/Pokemon/Eggs/", species, form, "_cracks")
      return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000_cracks")
    end

I can not remember touching this script, especially not in-between adding the switch mechanic into the UI_egg_hatching script, but the switch I was trying to use was switch number 60, could that have anything to do with it? I don't really see why it would but I'm kind of at a loss haha.

I fixed the code to what you have and it works now, thank you!
 

wrigty12

Tester-Coder Hybrid
Member
Joined
Jul 24, 2022
Posts
270
Age
29
I just checked, and it, for some reason, looks like this instead:

Ruby:
    def self._cracks_sprite_filename(species, form)
      ret = self.check_egg_graphic_file("Graphics/Pokemon/Eggs/", species, form, "_cracks")
      return (ret) ? ret : pbResolveBitmap("Graphics/Pokemon/Eggs/000_cracks")
    end

I can not remember touching this script, especially not in-between adding the switch mechanic into the UI_egg_hatching script, but the switch I was trying to use was switch number 60, could that have anything to do with it? I don't really see why it would but I'm kind of at a loss haha.

I fixed the code to what you have and it works now, thank you!
Sometimes you just accidentally delete something. I've done it many times! :S
 
Top