Patch:Light switch

From KeenWiki
Jump to: navigation, search

This page deals with patches relating to the light switches in Keen Vorticons. These switches are related to bridge switches. It also deals with the color changes associated with turning the lights on and off. Related patches can be found at Patch:Palette


Levels start with lights off

This patch makes all normal levels start with the lights off palette. It does not affect the map level, main menu level or ending sequence. It works by essentially running the 'lights turn off' code at level start (Which means if the usual fade in palette sequence is used there will be a short flash of 'lights on' palette seen as the level loads

Patch: Keen 1
#Levels start with lights off:
%patch $4C92 $E8 $1FB4W $90 $90 $90 %patch $4CA1 $E8 $E90EW

Patch: Keen 2
#Levels start with lights off:
%patch $79F6 $E8 $B45EW $90 $90 $90 %patch $7A05 $E8 $E9ECW


Palette

See Patch:Palette. This is the two palettes used by the game when the lights are on and off in a level. The palette patch page shows better how these work and shows the locations and pointers to every palette in the game.

As with text patches palettes must be pointed to (see the page for more details on this.) By default the game uses the second 'screen fade out' palette for lights off.

Patch: Keen 1
#Light palettes:
%patch $35A9 $253BW
#Lights on
%patch $35C9 $2519W
#Lights off

Patch: Keen 2
#Light palettes:
%patch $640B $2479W
#Lights on
%patch $63EB $249BW
#Lights off

Patch: Keen 3
#Light palettes:
%patch $6C4D $2597W
#Lights on
%patch $6C6C $2519W
#Lights off


New palette

This lets you make and use a custom palette for lights off (by default it uses one of the screen fading palettes.) This is a color-swap patch, explained in Patch:Palette. It is incompatible with the new palette color change patch seen there. Note that you should use only one of the two bottom patch lines otherwise you won't be able to tell the difference between lights on and lights off.

Looking at Patch:Text patches will give you some idea how the pointers to the patch (last two lines) work and Patch: Palette will give you the pointers to other standard game palettes. The demo palette used here is monochrome (black and white.)

Patch: Keen 1
#Make a new palette and use it for...
%patch $177C4 $1F $1F $1F $1F $1F $1F $1F $1F $00 $00 $00 $00 $00 $00 $00 $00 $00 %patch $640B $0044W
#...Lights off
%patch $63EB $004W
#...Lights on

Patch: Keen 2
#Make a new palette and use it for...
%patch $177C4 $1F $1F $1F $1F $1F $1F $1F $1F $00 $00 $00 $00 $00 $00 $00 $00 $00 %patch $640B $0044W
#...Lights off
%patch $63EB $0044W
#...Lights on

Patch: Keen 3
#Make a new palette and use it for...
%patch $19824 $1F $1F $1F $1F $1F $1F $1F $1F $00 $00 $00 $00 $00 $00 $00 $00 $00 %patch $6C6C $0004W
#...Lights off
%patch $6C4D $0004W
#...Lights on


Disable

It is possible to make the lights turn off, but not on, or on, but not off (If using the lights off at start patch above.) This may be useful if you want the lightswitch to change a level's gameplay permanently. Of course, using both patches makes the light switches do nothing. (But make a click sound.)


Patch: Keen 1
#Stop lights...
%patch $3722 $FE8DW
#Turning off
%patch $3728 $FE67W
#Turning on

Patch: Keen 2
#Stop lights...
%patch $6564 $FE8DW
#Turning off
%patch $656A $FE67W
#Turning on

Patch: Keen 3
#Stop lights...
%patch $6DC2 $FE8DW
#Turning off
%patch $6DC7 $FE67W
#Turning on


Switch speed

It takes time for the screen to change when the lights are switched on\off; by default this is pretty quick, so you don't notice much. It can be made longer however. When the screen is switching, everything is frozen, which may be an effect that is desired.

Patch: Keen 1
#Speed of lightswitcing:
%patch $359C $0001W
#Off
%patch $35BC $0001W
#On

Patch: Keen 2
#Speed of lightswitcing:
%patch $63DE $0001W
#Off
%patch $63FE $0001W
#On

Patch: Keen 3
#Speed of lightswitcing:
%patch $6C60 $0001W
#Off
%patch $6C41 $0001W
#On


Lightswitch tile

This is the 'official' light switch tile in-game. Apparently this does something, but there is no apparent problems with using other tiles given the light switch property. In other words, this patch may well be useless.

Patch: Keen 1
#Change lightswitch tile (Tile must have lightswitch property)
%patch $36D6 $010FW

Patch: Keen 2
#Change lightswitch tile (Tile must have lightswitch property)
%patch $$6518 $010FW

Patch: Keen 3
#Change lightswitch tile (Tile must have lightswitch property)
%patch $$6D76 $010FW


Switch sounds

This sound is also used for the bridge switches.

Patch: Keen 1
%patch $35DB $19     
#Flip switch sound
%patch $35DA $EB $07
#Flip switch sound disabled

Patch: Keen 3
%patch $6C7E $19     
#Switch flip sound
%patch $6C7D $EB $06
#Switch flip sound disabled