Egg patch request

Request patches for Keens 4-6.
Post Reply
User avatar
Alopex
Posts: 28
Joined: Thu Jun 15, 2017 7:27 pm
Location: Bloogfoods, Inc.

Egg patch request

Post by Alopex »

I'd like to make the Egg deadly and that it spawns, when shot, a Skypest instead of a Blue Bird.
User avatar
troublesomekeen
Posts: 223
Joined: Fri Feb 03, 2012 7:56 pm
Location: Shadowlands
Contact:

Re: Egg patch request

Post by troublesomekeen »

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.

Code: Select all

#Eggs hatches flying skypest
%patch $10135 $2486W
(a behind the scenes video on this patch to be uploaded later on breakdownhouse: https://youtu.be/H1rwdipbk9g )
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Egg patch request

Post by levellass »

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.

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
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:

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
If you want it to be landed pest this can bee done too, we just need to tweak its spawn height.
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Re: Egg patch request

Post by Fleexy »

To add the patch to your mod, you can copy and paste the last two sections in Levellass's post into your patch file.
Post Reply