Ship parts add instead of setting values

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

Ship parts add instead of setting values

Post by levellass »

Reccently I posted some patches that involved changing what values of something were needed to win, etc in Keen 1 ( viewtopic.php?t=1081&start=0&postdays=0 ... highlight= )

However, someone recently pointed out to me that they were pretty useless since the parts in Keen do not add, as ammunition does, but set a value. (Thus, getting the pogo sets the value of 'pogo' to 1, even if Keen starts the game with 20 pogo, getting a pogo tile will set it to 1) This is of course no good, so I have found the required patches to make it so various things add (20 pogo + 1 pogo = 21 pogo)

With these patches you can do things such as getting Keen to save 8 cities to win, or turn 'spare' ship parts (Seriously, 4 is so cliche!) into new points, or negative items or pogo stealers, whatever.

Code: Select all

#Item counters ADD (Instead of SET):
%patch $4446 $83 $06 $94 $AA $01 $90 #Joystick
%patch $445E $83 $06 $96 $AA $01 $90 #Battery
%patch $446A $83 $06 $98 $AA $01 $90 #Vaccum
%patch $4452 $83 $06 $9C $AA $01 $90 #Whiskey
%patch $44AB $90 $83 $06 $9A $AA $01 #Pogo

#Type table for patches:
$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

EXAMPLE 1: Keen must save 8 cities to win

Here we just change the joystick to add, then use some patches from the linked topic above so that we need 8 joysticks (Cities) and 0 of anything else to win. For compactness I left out any status box patches to fiddle this.

Code: Select all

#Get 8 cities to win:
%patch $4446 $83 $06 $94 $AA $01 $90 #Joystick adds
%patch $8022 $94 $AA $08 $72 #Joystick (8 or more)
%patch $8029 $9C $AA $01 $74 #Battery (0)
%patch $8030 $96 $AA $01 $74 #Vacum (0)
%patch $8037 $98 $AA $01 $74 #Whiskey  (0)

EXAMPLE 2: Joystick is 1 bullet

Here I change the Joystick to give 1 ammo and set its winning value to not 1 (Note the condition $74 and the type is $C8, raygun ammo)

Code: Select all

#Joystick 1 ammo:
%patch $4446 $83 $06 $C8 $AA $01 $90 #Joystick adds ammo
%patch $8022 $94 $AA $01 $74 #0 joystick to win

There are even ways (Via modifying the status box) to place a '% complete' box in the status window (Using parts tiles) that can give an idea of how much of the game you have done, and other such things, I hope this lets us escape the limitations of 'get 4 things and leave' that have plagued Keen 1

Enjoy! :)
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Hmm. I wonder how much of a stretch it would be to add one variable to another. That would be a step closer to a complete Infinite Lives patch, where in-level points are counted in the Next Keen At variable and added to the total score at the end of the level (or set to zero when the player dies).
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

The problem here is that there is absolutely NO implementation of this in the Keen code that I have been able to find, all variables either increment by x or are set to x. I have some hope that when saved games are loaded the 'Extra Keen at' variable is set by raising it incrementally until it is larger than the points variable, but even this would only be a step up.

At the moment all I have is 'Keen dies -> points go to zero' and a tentative 'Keen exits level, gets a bonus of x if he has more than y of something' patch
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

Indeed. I've been trying to find how points are added when Keen collects items, but no such luck yet. Things are not very straightforward in that area, it seems. If we can figure that out, it's much less of a stretch to figure out how to access the variables in question and add them to each other.
Post Reply