Patch:Level start

From KeenWiki
Jump to navigation Jump to search

This page contains patches that deal with what occurs each time a level is started. Though often not visible a significant amount of code is run when a level is entered. Not only to read the level and set it up, but also to alter various things about the game. Most notable is the fact that God mode is turned off when starting a level in Keen Vorticons.

This page is divided into two sections; the first contains patches that stops something happening (such as turning off God mode) while the second contains patches that alters what happens (such as what Keen loses when he starts a level.)

See also Patch:Level Entry Window, Patch:Levels (Galaxy).


Stop stuff happening

Don't turn off god mode on level entry

God mode is turned off when starting a level in Keen Vorticons by default. This patch alters things so that if God mode has been turned on it will not be turned off. It is a side effect of, and thus incompatible with, the patches in the following sections.

Keen 3

#Don't turn off god mode on level entry
%patch $81D1 $90 $90 $90


Don't lose keygems on starting a level

This patch stops Keen from losing his keygems when he switches levels (But not when he dies.) This allows Keen to carry gems from level to level and use gems in one level on another.

Don't lose keygems on starting a level

#Don't lose keygems on starting a level - Keen 4
%patch $6A56 $EB $19

#Don't lose keygems on starting a level - Keen 5
%patch $6A18 $EB $11

#Don't lose keygems on starting a level - Keen 6
%patch $6A56 $EB $19


Don't lose keygems or V card

This patch, which applies only to Keen 5, stops Keen losing not only his keygems but also his V card on leaving a level (but again, not when dying.).

Keen 5

#Don't lose keygems or V card on starting a level
%patch $6A11 $EB $1E


Don't lose V card on starting a level

Applying only to Keen 5, this patch prevents Keen from losing any V cards he has when starting a level. His keygems will still be affected.

Keen 5

#Don't lose keygems or V card on starting a level
%patch $6A2B $EB $04


Change what happens

Set something at level start

This patch is similar to the above patch, overwriting the God mode switch. Instead a game stat is set to something. In this example Keen is given ten seconds of Ankh time. Keen can also have his ammo set to something (including zero) or be given keycards, etc.

Keen 3

#Set Ankh to this at level start
%patch $81CE $C7 $06 {$9946W} [$00FAW]


Give Keen ammo if he is low on level start

This patch gives Keen 5 ammo if he has less than this when starting a level. This means that the 'IF rayguns' become less effective and can even be removed. By changing the brown variable what is given can also be altered. This patch is incompatible with the 'lose all points gained in a level when dying' patch.

Give Keen ammo if he is low on level start

#If Keen has < 5 ammo on level start, set it to 5 - Keen 4
%patch $69E3 $83 $3E {$7A58W}  [$05] {$73} $49 $C7 $06 {$7A58W}  [$0005W]  $EB $41

#If Keen has < 5 ammo on level start, set it to 5 - Keen 5
%patch $699E $83 $3E {$6F56W}  [$05] {$73} $49 $C7 $06 {$6F56W}  [$0005W]  $EB $41

#If Keen has < 5 ammo on level start, set it to 5 - Keen 6
%patch $67D4 $83 $3E {$7590W}  [$05] {$73} $49 $C7 $06 {$7590W}  [$0005W]  $EB $41


Things set to 0 on starting Galaxy levels

In Keen Galaxy certain variables are set to 0 when Keen starts a level, specifically all four keygem values. In the default given here it can be seen 8 bytes (2 bytes per value is 4 values.) are cleared starting at the first keygem value clearing all four gems. If the number of bytes changed is set to 2 the only a single variable will be cleared. If the 'start variable' is changed something other than gems will be affected.

As an example, making the number of bytes cleared $000CW (12) and the start variable $7A5CW (Wetsuit) keen will lose the Wetsuit if he has it and any Council Members saved as well as his keygems when starting any level (Including the map.)

Things set to 0 on starting Galaxy levels

#Things set to 0 on starting Galaxy levels - Keen 4
%patch $6A5E [$0008W] #Number of variables affected * 2
%patch $6A65 {$7A60W} #Start variable

#Things set to 0 on starting Galaxy levels - Keen 5
%patch $6A19 [$0008W] #Number of variables affected * 2
%patch $6A20 {$6F60W} #Start variable

#Things set to 0 on starting Galaxy levels - Keen 6
%patch $684F [$0008W] #Number of variables affected * 2
%patch $6856 {$759CW} #Start variable


Have one or more V cards when starting a level

This patch ensures Keen always has a V card when starting any level, including the map. He will be given the card whenever he leaves a level, but will lose it when he dies and retries a level. The value here can be other than 1 if desired.

Keen 5

#Have a V card on starting a level
%patch $6A2F [$0001W]


Give\take something instead of a V card on level start

This patch alters what is affected at level start so it is not necessarily a V card. This variable can also be set to other values aside from 0 or 1; in this case keen will start all levels with 10 ammo. Notice that if Keen dies he will lose the V card but not what is given here.

Give\take something instead of a V card on level start

#Start levels with 10 ammo
%patch $6A2D {$6F56W}  [$000AW]


Keen loses all points gained in a level if he dies in it

This patch does not strictly deal with the start of levels; however the score is stored at the level start meaning that it relates closely to other patches here. As such the patch is not included on this page but instead is linked here.