Egg patch request
Egg patch request
I'd like to make the Egg deadly and that it spawns, when shot, a Skypest instead of a Blue Bird.
- troublesomekeen
- Posts: 223
- Joined: Fri Feb 03, 2012 7:56 pm
- Location: Shadowlands
- Contact:
Re: Egg patch request
I don't know about making the Egg dangerous while still spawning a creature, but this patch may do the trick for an Egg spawning a skypest.
(a behind the scenes video on this patch to be uploaded later on breakdownhouse: https://youtu.be/H1rwdipbk9g )
Code: Select all
#Eggs hatches flying skypest
%patch $10135 $2486W
Re: Egg patch request
Alright, let's see here.
Firstly we'll need to fiddle the Egg's smashing code, this is quite complex, fortunately the existing code is a mess. We can rewrite the first two lines to check for Keen and kill him and check for his shot and go to the rest of the code.
Basically we want the Egg to check for Keen, kill him if found then go to the end of the code. Then, if Keen is not found, look for his shot. Now as it turns out there's not quite enough space to do this the traditional way, so after it checks for Keen's shot I have a *backwards* jump to the 'go to code end' jump, a bit confusing but the patch works out perfectly:
Now, the Skypest! The previous poster's patch works fine for this; but will cause an error unless there's already a Skypest in the level. To prevent this we go to the sprite spawning section and see that it sets the Bird's cache as well as the Egg's when it spawns. (This is around $EB0F) We just change this to the Skypest's cache and viola! The egg hatches a Skypest with no problems!
If you want it to be landed pest this can bee done too, we just need to tweak its spawn height.
Firstly we'll need to fiddle the Egg's smashing code, this is quite complex, fortunately the existing code is a mess. We can rewrite the first two lines to check for Keen and kill him and check for his shot and go to the rest of the code.
Code: Select all
#Original egg code
%patch $100A7 $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D $03 $74 $08
$83 $3D $02 $74 $03 $E9 $0136W $83 $3D $03 $75 $09
Code: Select all
#Egg kills Keen but hatches bird when shot:
%patch $100A7 $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D $02 $75 $08
$9A $0B8013E9RL $E9 $0136W $83 $3D $03 $75 $F8
Now, the Skypest! The previous poster's patch works fine for this; but will cause an error unless there's already a Skypest in the level. To prevent this we go to the sprite spawning section and see that it sets the Bird's cache as well as the Egg's when it spawns. (This is around $EB0F) We just change this to the Skypest's cache and viola! The egg hatches a Skypest with no problems!
Code: Select all
#Egg hatches a Skypest
%patch $10135 $2486W
%patch $EB0F $69
Re: Egg patch request
To add the patch to your mod, you can copy and paste the last two sections in Levellass's post into your patch file.