Lives left box

Completed patches for Keen1.
Post Reply
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Lives left box

Post by levellord »

As requested by Spleen, here is how you make the lives left box that appears after you die or exit a level, do whatever you want.

Firstly I have discovered that Keen uses 2 types of text box. [This includes Keen 4-6 and dreams] the first is controlled by four variables [left side, right side, top, bottom] and the other 2 variables [centered on the screen, width and height] The ending sequence uses the former, the status box the former.

For Keen 1:

#Lives left box height
%patch $8F2E $04 $00
#Lives left box length
%patch $8F32 $10 $00
#Text read from:
%patch $8F42 $88 $2E
#The sprite used for keens
%patch $8F5B $90 $00
#Keens y position [pixels] from top of box
%patch $8F68 $0B $00


With the sprite used, be careful. Sprite 00 is Keen looking right, and the value shown is nowhere near the sprite number. [Default 90 is sprite number 39 for example]

Now we can see how to make the screen [almost] dissappear:

%ext.ck1
#Lives left box height [0]
%patch $8F2E $FF $FF
#Lives left box length [0, reduces the box to 1 8x8 square]
%patch $8F32 $FF $FF
#Text read from: [1 less, so text is erased.]
%patch $8F42 $87 $2E
#The sprite used for keens [That sprite that isn't used, you can alter it.]
%patch $8F5B $79 $00
#Keens y position [pixels] from top of box [Put sprite off screen]
%patch $8F68 $70 $00


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

Go team.

Post by CommanderSpleen »

Nifty. Cheers, LL.

Knowing this, it's easy to completely bypass the Keens Left window entirely by placing a return statement at the very start of the function:

Code: Select all

#Don't display the Keens Left window (Keen1)
%patch $8F26 $C3
There's still a slight pause before Keen appears on screen, however.

Edit: Hmm... seems the code for playing the sound is also buried in that chunk. *experiments*

Edit: Heheh:

Code: Select all

#Play the world-enter sound, but then return to the menu (Keen1)
%patch $8F27 $90 $90

Edit: Here we go...

Code: Select all

%ext ck1
%version 1.31

#Don't display the Keens Left window at all
#But still play the world-enter sound
#Part 1: Remove the bounding box
%patch $8F2D $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 
             $90 $90 $90 $90 $90 $90 $90 $90 $90 $90
#Part 2: Remove the loop that displays the lives
%patch $8F5A $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 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90 $90

%end
The pause still remains... maybe I can rearrange the code to make the sprite appear before the sound plays...
Last edited by CommanderSpleen on Mon Jul 04, 2005 2:38 pm, edited 2 times in total.
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

And we also have the sound used, so we can have the window without the sound and so on:

Keen 1

#Enter map sound [values 00-40]
%patch $8F82 $29 $00
Post Reply