Losing or getting stuff when you die or exit

Completed patches for Keen1.
Post Reply
levellass
Posts: 2841
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Losing or getting stuff when you die or exit

Post by levellass » Thu Sep 18, 2008 1:34 pm

Found while looking for Tulip's patch.

There are four levels where, if you die, you will lose a ship part. This is so that if you DO get a part in that level, but die, you will lose it, but this has caused some problems for some people who put parts in the 'wrong' levels. You can of course patch this so it doesn't happen, but the following patches allow a bit more... fine control.

The keycards are also taken from you when you exit a level, and there is great potential here too.

These patches allow you to select not just what level, but also what is lost (Set to zero) from points to pogo.

Note that if you really want to be sadistic, using the keycard patches can be done so that every time Keen dies, he loses his pogo or his lives are reset, etc. I can also make the parts patches such that if Keen EXITS or dies in ANY level his parts (Or points or pogo or...) is taken from him.


First up the existing patches to make this not happen at all:

Code: Select all

#Keen doesn't lose ship parts on dying in their levels.
#Each line is separate and for 1 part
%patch $4F82 $90 $90 $90 $90 $90 $90 #Joystick
%patch $4F8A $90 $90 $90 $90 $90 $90 #Battery
%patch $4F92 $90 $90 $90 $90 $90 $90 #Vacum
%patch $4F9A $90 $90 $90 $90 $90 $90 #everclear

#Don't affect Keen's keycards
%patch $4F43 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 
             $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 

Now we can change the levels that are affected:

Code: Select all

#Parts levels (Part removed if you die in this level)
%patch $4F69 8  #Joystick
%patch $4F70 3  #Battery
%patch $4F75 4  #Vacum
%patch $4F7C 16 #Everclear

Now by altering the default values we can change what the effect is, and what it affects. (See the bottom of this post for a list of effect bytes; the keycard patch cannot be modified like this.)

Code: Select all

#What happens in special levels; first byte is what is affected,
#last two are what it is set to:
%patch $4F8C $94 $AA $00 $00 #Joystick
%patch $4F84 $9C $AA $00 $00 #Battery
%patch $4F94 $96 $AA $00 $00 #Vacum
%patch $4F9C $98 $AA $00 $00 #Everclear

Now two patches for what happens when you exit or die in a level; you can see eight values to edit in each patch, four amount values, and four type values; just like in the above patch, but these one are a bit longer. (Again see the bottom of this post for a list of value bytes.)

Code: Select all

#When Keen dies, lose or gain parts; there are four values, one for each part (B,V,J,E)
#If zero, then the part is taken, if 1 it is given this patch takes all parts when you die
%patch $8041 $E8 $16 $CF $90 
%patch $4F58 $EB $46 $C7 $06 $94 $AA $00 $00 $C7 $06 $96 $AA $00 $00 
             $C7 $06 $98 $AA $00 $00 $C7 $06 $9C $AA $00 $00 $FF $0E 
             $C6 $AA $C3 

#When exiting level, lose or gain parts; there are four values, one for each part (B,V,J,E)
#If zero, then the part is taken, if 1 it is given this patch takes all parts at exit
%patch $8041 $E8 $16 $CF $90
%patch $4F58 $C7 $06 $9C $AA $00 $00 $C7 $06 $94 $AA $00 $00 
             $C7 $06 $96 $AA $00 $00 $C7 $06 $98 $AA $00 $00 
             $EB $2E
Finally we can modify the keycards patch so that when Keen dies four things are changed, just like the aboe patch (Just in case you didn't want to waste those parts.)

Code: Select all

#When Keen dies, four things are changed; this patch
#gives all keycards at death
%patch $8041 $E8 $16 $CF $90
%patch $4F58 $EB $46 $C7 $06 $9E $AA $01 $00 $C7 $06 $A0 $AA $01 $00 
             $C7 $06 $A2 $AA $01 $00 $C7 $06 $A4 $AA $01 $00 $FF $0E 
             $C6 $AA $C3 

Finally, what all those strange $xx $AA bytes mean!

Code: Select all

#What the four parts bytes mean:
$94: Joystick  $96: Vaccum      $98: Whiskey  $9A: Pogo       
$9C: Battery   $9E: Yellow card $A0; Red card $A2: Green card 
$A4: Blue card $A6: Level 1     $A8: Level 2  $AA: Level 3
$AC: Level 4   $AE: Level 5     $B0: Level 6  $B2: Level 7
$B4: Level 8   $B6: Level 9     $B8: Level 10 $BA: Level 11
$BC: Level 12  $BE: Level 13    $C0: Level 14 $C2: Level 15
$C4: Level 16  $C6: Lives       $C8: Ammo     $CA: Points

Now, there is a LOT of flexibility here; you do some wonderful, or terrible things if you know what you are doing. I hope this inspires some gameplay challenges. :D

User avatar
Fleexy
Site Admin
Posts: 472
Joined: Fri Dec 12, 2008 1:33 am
Location: Blogham Tower
Contact:

Post by Fleexy » Wed May 06, 2009 12:31 am

[quote=levellass]

Code: Select all

#Parts levels (Part removed if you die in this level) 
%patch $4F69 8  #Joystick 
%patch $4F70 3  #Battery 
%patch $4F75 4  #Vacum 
%patch $4F7C 16 #Everclear
[/quote]

I'm not sure if those levels are correct. It might be like this:

Code: Select all

#Parts levels (Part removed if you die in this level) 
%patch $4F69 4  #Joystick 
%patch $4F70 3  #Battery 
%patch $4F75 8  #Vacuum 
%patch $4F7C 16 #Everclear
Let me know how it works out!

--Fleexy

:D | 8) | 8D | :)[/quote]
Last edited by Fleexy on Mon Jun 01, 2009 6:07 pm, edited 1 time in total.

levellass
Posts: 2841
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Wed May 13, 2009 1:04 am

Well, the patch is correct, but perhaps the labeling isn't, I'm not sure. Either way, shouldn't be too hard to test.

Post Reply