Patch:Oracle Council Message

From KeenWiki
Jump to navigation Jump to search

Council Members are red robed figures Keen must rescue in Keen 4 to win the game. Eight must be found and touched, whereupon a text window will appear and the level will be exited.

This page deals with the text boxes and what happens. (Music changes, a member is rescued, level ends...) For what the member sprites do and how they behave, see Patch:Council Member.

How many Members must be saved

This check is run every time a level is exited. Keen will win the game by default if he has rescued eight council members. It is possible to change what is looked for, how many are required and the jump conditions.

The first value is what is looked for, the second how many and the third the jump condition.

Keen 4

#What wins game (Default 8 members)
%patch $6AE4  {$7A5EW}  [$08] {$74}

Disable message

These patches disable various aspects of the council messages

Completely disable message

This patch completely disables the member message, touching the member (Or any sprite with sprite type 6.) will have no effect... unless Keen is in the Oracle Janitor level, since the Oracle janitor is not affected. Notice however that the message activation code that this skip (See section below) also checks if the game is won, so using just this patch will cause the game to be incompleteable.

Keen 4

#Completely disable Council Member messages
%patch $CD93 $13

Disable both message windows

This patch disables the message windows and saving the council member. Touching a member plays a sound then wins the level.

Keen 4

#Disable Council Member messages
%patch $F4D5 $5F $5E $8B $E5 $5D $CB

Disable Elder's window

This patch removes the Elder's window so only Keen's reply appears.

Keen 4

#Disable Council Member message window
%patch $F52E $90 $90 $90 $90 $90
%patch $F544 $90 $90 $90 $90 $90
%patch $F534 $0004W

Disable Keen's reply, save elder

This patch removes Keen's reply textbox entirely, that is, all that will appear is the Elder's window. (Which can have only one of two different messages, normal or underwater.) The level will then be exited. The council member is however, saved.

Notice this affects the patch relating to what gets saved; the brown value is what is increased by 1 every time an elder is saved, if using this patch changes must be made there instead of using the patch that appears elsewhere on this page.

Keen 4

#Don't display Keen's reply boxes to the Gnostice Ancients
%patch $F549 $FF $06 {$7A5EW}  $9A $12A614EDRL     $9A $06BD2092RL     $B8 $0000W
             $50 $9A $1D06030DRL     $44 $44 $5D $CB

Keen doesn't exit level after meeting a Member

This patch allows Keen to continue playing the level after meeting the Member. This is done by first changing the Member's type so it doesn't trigger the exit level sequence. The collision causes the Member to transform into a raindrop splash when Keen hits it (This can be changed.) so that Keen is not stuck in an infinite loop of messages. This patch uses the EGAGRAPH skip so is incompatible with other patches that use it. It also removes the only way to win the game by default, so some other way to win must be used.

Note that the third patch line stops the music stopping, if it is removed then the level will be silent after the member is rescued.

Keen 4

#Disable level end type
%patch $FCFD  $01

#Disable EGAGRAPH check in Keen 4 (Frees 389 bytes at $3CF6)
%patch $3CE5 $90 $90

#Don't stop music after Member vanishes
%patch $F5E7 $90 $90 $90 $90 $90

#Member collision; if Keen run oracle windows and transform = $037D0526RL
%patch $3CF6 $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D [$02] {$75} $0F
             $C7 $44 $1C $1F46W  $9A $0E8F0BA5RL     $9A $16540D59RL     $FF
             $36 $7A68W  $9A $06BD20C7RL     $83 $C4 $02 $5F $5E $8B $E5 $5D $CB

#Use new collision
%patch $30E3C $037D0526RL
%patch $30E5A $037D0526RL
%patch $30E78 $037D0526RL

Text Windows

These are the text windows that appear when Keen rescues a Council Member. There are two of them each time, the Member's, which is always the same (Except for one special level under water.) and Keen's, which become increasingly disrespectful each time. When the window appears the music changes, and when the conversation is over the level is exited and completed.


The windows must cache the graphics they are using before they appear. In this case three sets of images are saved; Keen's head, the member's head and Keen giving a thumbs up. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK4; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six.

Keen 4

#Bitmap cache (3 bitmaps, 104-6)
%patch $F4AE [$006EW] #Cache Council Member graphic
%patch $F4B5 [$006FW] #Cache Talking Keen head
%patch $F4BC [$0070W] #Cache Keen's thumbs up

#Display bitmaps
%patch $F4EB [$006EW] #Council Member (Window 1)
%patch $F55A [$006FW] #Keen talking (Window 2)
%patch $F5AC [$0070W] #Thumbs up (Window 2)

Window Setup

Both of the windows displayed must be set up. There are a few variables to consider; the first two involve the size of the window in 8x8 tiles. Next is the image shown in the window followed by how long the window is displayed (After the player presses a key.). This last one roughly defines how quickly the player can 'rush past' the window.

The remaining variables deal with and where the window's text is read from. The text must not only be read but placed in the window, sharing space with the displayed image. The first variable controls how far down the window the first line of text appears, the text's 'vertical position'. The next two variables control the text's 'horizontal position'; the first sets 'border' past which text cannot be written, by default this is as wide as the display image, preventing text appearing over it. The second variable controls the text's 'centering' and is how far from the border the text's center is. Finally there is the location in the text segment the window's texts are stored. (See Patch:Text patches).

Keen 4

#Council member window
%patch $F4DB [$0008W] #Height
%patch $F4DF [$001AW] #Width
%patch $F4EB [$006EW] #Bitmap displayed (104)
%patch $F534 [$003CW] #Time window remains

%patch $F502 [$0F]    #Pixels from window top text starts
%patch $F507 [$30]    #Pixels from window right of text border
%patch $F50C [$30]    #Text centering (Window right)
%patch $F523 [$1DA7W] #Normal text read from
%patch $F515 [$1D43W] #Underwater text read from

#Council member text
%patch $30C17 "Oh thank you so much" $0A
              "for rescuing me!" $0A
              "I'll return to the" $0A
              "Oracle chamber" $0A
              "immediately" $00

#Underwater council member text
%patch $30BB3 "Ggoh thig you sogh mg" $0A
              "fgor regscuing mgge!" $0A
              "I'gll regur tgo the" $0A
              "Gracle chagber" $0A
              "igmmediatggely. Blub." $00

Keen has several replies, a new one for each member saved. The window references a list of pointers to the various replies. (This will usually not need to be altered.) The reply used depends on how many members have already been rescued. (Starting with 0) It is possible to change this.

The location of the bitmap can also be changed; it is offset somewhat from he right of the window (It is centered vertically.) This is useful if the bitmap's size is changed. (Text should not be drawn over the bitmap.)

Keen 4

#Keen's reply window
%patch $F54A [$0008W] #Height
%patch $F54E [$001AW] #Width
%patch $F55A [$006FW] #Bitmap displayed (105)
%patch $F569 [$0030W] #Bitmap position from RIGHT of window
%patch $F578 [$30]    #Text centering, (also Thumbs Up H position!)
%patch $F57D [$0C]    #Pixels from window top text starts
%patch $F596 [$001EW] #Pause after keypress before Keen gives thumbs up
%patch $F5AC [$0070W] #Keen's thumbs up bitmap
%patch $F5C6 [$001EW] #Pause before Exit to Shadowlands window appears

%patch $F580 {$7A5EW} #What is counted
%patch $F586 [$19DCW] #Location of text pointer list

#Replies pointer list
%patch $3084C [$1C01W] #First reply
              [$1C22W] #Second reply
              [$1C43W] #Third...
              [$1CFBW] #Eighth reply

#Keen's replies:
%patch $30A71 "No sweat, oh guardian" $0A
              "of wisdom!" $00

%patch $30A92 "Sounds like a plan," $0A
              "bearded one!" $00

%patch $30AB3 "No problemo." $00

%patch $30AC0 "Great.  You know, you" $0A
              "look a lot like the" $0A
              "last guy I rescued..." $00

%patch $30B00 "Good idea, Gramps." $00

%patch $30B13 "May the road rise" $0A
              "to meet your feet," $0A
              "Mr. Member" $00

%patch $30B44 "Wise plan of action," $0A
              "your ancientness." $00

%patch $30B6B "Your the last one," $0A
              "fella.  Let's both" $0A
              "get back to the" $0A
              "Oracle chamber!" $00

Don't wait for the player to press a key

These patches remove the 'wait for key' code; that is, the window will automatically move on to the next window without the player pressing anything. This means the player must read the window within a certain period of time, and makes the conversation seem far more urgent.

Keen 4

#Remove Council Member wait-for-key
%patch $F52E $90 $90 $90 $90 $90

#Remove Keen's reply wait-for-key
%patch $F5A6 $90 $90 $90 $90 $90

Different types of elder message

What level\condition gives the underwater elder

By default the game displays the 'underwater elder' message when Keen is in level 15 ($11). It is possible to change what is checked for and what value it must have. (The default checks if current level = 15) It is possible to have the underwater message on several levels, or when Keen has a certain object.

Keen 4

#Check for underwater elder
%patch $F50F {$A7EDW}  [$11] {$75}

Three types of elder text

This patch alters the game so that there are 'three' different types of elder, instead of the default two. In this example the two 'special' levels are levels 17 and 18 ($11 and $12.) With careful jump condition tweaking this can be made to affect multiple levels.

The extra message is included here for completeness, but will overwrite error messages if used.

Keen 4

#Allow 3 different elder messages
%patch $F50F {$A7EDW}  [$11] {$75}
%patch $F513 $05 $B8 [$1D43W]  $EB $0F $83 $3E {$A7EDW}  [$12] {$75} $05 $B8 [$40B7W]  $EB $03
             $B8 [$1DA7W]  $50 $9A $19310EBDRL     $9A $1D060A9BRL
%patch $F53E $04

#Message -40B7
%patch $32F27 "Oh thank you so much" $0A
              "for rescuing me!" $0A
              "The Shikadi must" $0A
              "pay for kidnapping us!" $00

Different message and\or reply for each level

By default the Oracle members give one of two messages (with one message only appearing in the underwater level.) and Keen's replies depend on how many members he has rescued already. This patch makes it such that the Member, Keen or both have different messages on every level. The two patches are completely separate and either one or both can be used.This makes the affected messages behave much like how the Yorp messages work.

Both these patches create a new list in a new location with space for 20 or more levels. In the patches given here two sets of each reply are used, so level 1 and level 9 have the same reply. (The map level, level 0 has its own reply, identical to level 8's.) The replies used are in the same place as the standard replies. It is up to the patcher to rearrange text and pointers to make their own custom messages.

If Keen touches a Member in a level with no pointer, odd stuff will occur.

Keen 4

#Different Elder message in each level
%patch $F50D $8B $1E {$A7EDW}  $D1 $E3 $FF $B7 [$3B59W]  $9A $19310EBDRL     $83
             $C4 $02 $EB $0D

#Free text space
%patch $329C8 $00

#Reply pointer list
%patch $329C9 [$1C01W] #Map
              [$1C22W] #Level 1
              [$1C43W] #Level 2...
              [$1CFBW] #Level 8
              [$1C01W] #Level 9 (Same as map)
              [$1C22W] #Level 10 (Same as 1)
              [$1C43W] #Level 11...
              [$1CFBW] #Level 16

Keen 4

#Keen's replies to elders depends on his current level
%patch $F580 $A7EDW #What is counted (Current level)
%patch $F586 $3EE5W #Location of text pointer list

#Message list
%patch $32D55 [$1C01W] #Map
              [$1C22W] #Level 1
              [$1C43W] #Level 2...
              [$1CFBW] #Level 8
              [$1C01W] #Level 9 (Same as map)
              [$1C22W] #Level 10 (Same as 1)
              [$1C43W] #Level 11...
              [$1CFBW] #Level 16

Save Member sounds

There re two sounds played when the member is saved. The first is the same sound played as when Keen exits the level. It is not heard however because it is immediately 'overwritten' by the second sound. The second is specific to the council members.

Keen 4

#Sounds played when member saved
%patch $6AC0 [$000DW] #Unheard 'exit' sound
%patch $CDAC [$001FW] #Oracle sound

Don't play sound

This stops the sounds being played. Each patch is independent and either or both can be used. Note that if the second sound is blocked the first will be heard and if both are blocked it is possible that it may affect things like the Wetsuit or Princess Lindsey since the first sound may also play (But not be heard) when they are found.

Keen 4

#Block sounds played when member saved
%patch $6ABF $EB $0A #First, unheard, sound
%patch $CDAB $EB $0A #Second


By default new music plays when the Oracle is being spoken to, and it is stopped afterwards. The song used is a unique one not used for other levels. See also Patch:Music.

Note that while the new music code is part of the Member window code, the 'stop old music' code is not. This may be important when the window code is called in an odd way. (Such as when a sprite dies.)

Music played

By default the song played is -1, a unique song. It can however be turned into positive values for other songs. In that case the value is not the song number, but rather the level number of what music is desired. (So a value of +1 will play the same music as plays in level 1.)

Keen 4

#Music played when Member is rescued
%patch $F4CA [$FFFFW]

Don't play any music (Silence)

This patch stops the music changing when Keen is talking to the Member. Instead there is silence. If this is combined with the following patch then the music will not change at all when the Member is rescued. (See below.)

Keen 4

#Silence while talking to Member
%patch $F4CD $90 $90 $90 $90 $90

Same music plays after Member rescued

If this patch is used the music remains the same. This is no consequence by default as the level then exits and the music stops anyway, but if other patches are used that allow Keen to keep playing the level then this will permanently change the level's music after the member has been rescued.

Note that the normal music will play if the game is saved then loaded.

Keen 4

#Same music plays after Member rescued
%patch $F5E7 $90 $90 $90 $90 $90

Message code

There are three sets of code run when a council member is saved. The first is a simple change of the 'level state' to 3 which then triggers the second set of code in the level loop. This in turn runs either the 'win game' or third set of code, which contains the actual message windows.

Change level state

This short patch is what changes the 'level state' to 3; checking out the linked page will show what happens if it is set to any other value. Note that changing this value will remove the only default way the game can be won.

This can be used anywhere in-game; in a sprite's behavior or collision of when Keen touches a tile. If it is replaced with a string of $90 then the message will be disabled. (This will also disable the 'win game' code.)

Replacing this string with $90s will stop the level state being changed at all, rendering the council member completely ineffective.

Keen 4

#Member message activation code
%patch $CDB7 $C7 $06 {$7A70W} [$0003W]

Level loop code

This code is run whenever the Council Member is saved. The first thing that happens is sound 13 is played. (Replacing the $9A $187409F1RL with $90 $90 $90 $90 $90 will stop the sound being played.

After this the current level is marked as done and the Council Member message windows appear. (This can be prevented by replacing the $$9A $0E8F0BA5RL with $90 $90 $90 $90 $90, we can also stop the level being marked as done by changing the $0001W to $0000W.)

The game then checks if exactly 8 members have been saved. If they haven't then sets the level to 0 (Map) and Keen goes there. Otherwise the 'win game' code is run. Notice this includes increasing Keen's score and the number of members saved.

Replacing the bytes $A1 $EDwith $EB $25 on the second line will make the game go directly to 'win game' when the member is contacted.

Keen 4

#Council member encountered code
%patch $6AB8 $83 $3E $ED $A7 $00 $74 $0C $B8 [$000DW]  $50 $9A $187409F1RL     #Play sound 13
             $83 $C4 $02 $A1 $ED $A7 $A3 $C2 $A7 $8B $1E $ED $A7 $D1 $E3 $C7
             $87 {$7A1EW}  [$0001W]  $9A $0E8F0BA5RL     $83 $3E {$7A5EW}  [$08] {$74} #Mark level as done, show member windows if 8 members saved...
             $09 $C7 $06 {$7A68W}  [$0000W]  $E9 $00AAW  $0E $E8 $F150W  $9A     #...goto level 0. Else...
         $16540139RL     $9A $1D060999RL     $9A $09150B2DRL     $FF $36     #Show member windows
         {$7A5EW}  $FF $36 {$7A52W}  $FF $36 $7A50W  $9A $03ED1BFERL     $83 $C4 #Inc member saved, hi-score 
             $06 $5E $5D $CB $EB $7E

Level Keen goes to when saving a member

This is the level that Keen goes to when he saves a member. By default it is level 0, the map. But the Member can take him to any other level, even ones not reachable from the map. it is also possible to change the game stat changed so Keen restarts the level, but is given something else.

This patch is part of the above patch and thus incompatible with it.

Keen 4

#Level Keen goes to when he rescues a member
%patch $6AEB {$7A68W}  [$0000W]

Message window code call

This short patch is the 'activation code' for the council member windows; calling it will display the member windows and Keen's replies and will also save a council member. (The windows however are not cleared from the screen afterwards.) It can be used anywhere in the game. Notice that it will not run the win-game check and that it is part of the code in the above section.

Keen 4

#Message window activation code
%patch $6ADD $9A $0E8F0BA5RL


These are patches that do not fit into any section above.

Restart level when contacting Member

This patch causes the level to restart when a Member is contacted. The level is not completed, nor is the message displayed.

Keen 4

#Getting member restarts the level
%patch $6AB8 $E9 $00E1W

Exit but don't complete level when contacting Member

This patch causes the level to end but not be won when a Member is contacted. The level is not completed, nor is the message displayed.

Keen 4

#Exit but don't complete level when contacting Member
%patch $6AD7 $EB $09

Don't complete level when Member rescued

This patch stops the level being completed when a Member is rescued. The message appears, a Member is added to the 'rescued' counter, Keen returns to the map but the level itself is not completed and can be reentered.

Keen 4

#Mark a level as done when rescuing a member
%patch $6ADB $0000W