This page deals with the Keen 6 map obstacle known as the slavering Grabbiter. It requires Keen to have an object (The Stupendous Sandwich of Chungella IV) to pass. Like most Keen 6 map objects its interaction with Keen revolves around text boxes that appear when Keen contacts it. It is thus worth checking Patch:Keen Galaxy Text Windows.
This page is divided up into two sections, the first deals with the Grabbiter's text windows, which appear when Keen contacts it on the map. The second deals with the Grabbiter's sprite properties, how the Grabbiter sprite itself works.
- 1 Grabbiter text windows
- 2 Grabbiter sprite properties
Grabbiter text windows
Each text window contains nine values that can be patched to change the window. The first two are the most simple, the window's size in 8x8 blocks. The third is how long the text window remains before the player can dismiss it. (This prevents accidental dismissal when the window 'pops up' during gameplay.) The next three relate to the text; the first two control where it is placed in the window (relative to the right and top edges of the window!) while the third controls where the text is read from.
The final three variables relate to the bitmap; it must be stored and then displayed and it too has a horizontal position in the window. Positions of all things range from 0-7F for being left and FF-80 for being right.
|Patch: Grabbiter text windows|
Keen's head appears on the left side of windows instead of the right
This patch modifies the two windows so that the text and bitmap stick to the opposite side of the window than the default. It will be noted that this is done by changing their horizontal positions from +48 ($30) to -46 ($D0).
|Patch: Keen's head appear on the left side of windows instead of the right|
Disable text windows
Grabbiter doesn't respond if Keen has the Sandwich
This patch stops the Grabbiter from responding when Keen has the sandwich. No window or sound appears and it will continue animating and Keen will be able to walk right by it.
|Patch: Grabbiter doesn't respond if Keen has the sandwich|
Disable fed text window
This patch disables the fed Grabbiter window. When Keen has the Sandwich the Grabbiter simply falls asleep when touched.
|Patch: Disable fed text window|
Complete window codes
These patches contain the complete code for various Grabbiter windows. They contain all the other window patches (and will thus overwrite them.)
Hungry Grabbiter window
This is the complete window code for the window that appears when the player touches the Grabbiter without the sandwich. It is not standalone code, instead being part of a larger code segment. The first line plays sound $39, as well as cache Keen's head bitmap ($0023W) which is then displayed on line 3. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK6; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six. The window's size is set on lines 2/3 as being $08x$1A
The image is aligned right by $0030W pixels. By default this is the same as the image's width so that the displayed bitmap is 'right aligned'. Paired with this is a second, equal variable that moves the text in the opposite direction so that it is not centered in the window (and thus overwriting the bitmap.) These variables can be 'reversed' by making them negative. (Changing $0030W to $00D0W and $30 to $D0 for example.)
Finally the text call on line 6 which determines where the window's text is called from. (See Patch:Text patches.) The value $001EW is the 'pause' before the player can dismiss the window by pressing a key. Finally after the window has been displayed the window is cleared and some miscellaneous code run.
|Patch: Keen 6|
Grabbiter sprite properties
These patches deal with the Grabbiter sprite itself, some of them control what triggers the text windows dealt with above.
The Grabbiter uses sprite type 30, which is what triggers Map Keen to start the Grabbiter conversation.
|Patch: Keen 6|
The Grabbiter has four actions in two cycles, hungry and napping. It's spawned either hungry or napping depending on whether or not Keen has fed it before. (This is necessary since Keen can revisit the map both before and after feeding the Grabbiter.)
If hungry the Grabbiter remains so until Keen feeds it, at which point it will change to the first napping action. Once napping the Grabbiter naps indefinitely.
Actions: $1A90W #Grabbiter hungry 1 $1AAEW #Grabbiter hungry 2 $1ACCW #Grabbiter napping 1 $1AEAW #Grabbiter napping 2
The Grabbiter has no behaviors of its own, it simply sits there doing nothing. Its interactions with Keen are controlled by its sprite collision.
The Grabbiter has no speeds, it sits completely still by default.
The hungry Grabbiter has a unique collision that responds to Keen and brings up its text windows. If napping however it has no collision and doesn't interact with anything.
%patch $327D4 $0EFC0574RL %patch $327F2 $0EFC0574RL
The Grabbiter has two animation sequences, one when hungry and one when napping. Each sequence is two actions long. The Grabbiter itself has no cache, depending on Map Keen's cache.
|Patch: Keen 6|
The Grabbiter has a foreground variable of 2, meaning it appears in front of all non-foreground tiles and most sprites. This is so that it always appears in front of Keen when he passes by it. It has no clipping to avoid issues on the map with blocking tiles.
|Patch: Keen 4|
The Grabbiter has no real need to interact with tiles and so uses a simple 'display sprite' interaction that does nothing but let it sit there.
As it does not move or do anything special the Grabbiter uses type 0 for all of its actions.
The Grabbiter has no need for either of these variables and so has a value of 0 for both in all of its actions.
The Grabbiter's spawning is quite simple. Its initiation relies on Map Keen, and so doesn't set any cache. In the spawning code proper $C7 $02 $xxxxW sets the sprite activity, $C7 $07 $xxxxW sets the sprite type, $C7 $20 $xxxxW sets the foreground value.
One complication is that the Grabbiter's starting action depends on whether or not Keen has fed it a Sandwich at any time in the game. If this is the case (The sandwich variable is 2.) then the napping Grabbiter is spawned, otherwise the hungry Grabbiter is. These values are the last two blue values in the code.
|Patch: Keen 6|
Grabbiter spawn has extra variable
This patch compresses the default Grabbiter spawn so that another sprite variable my be set. In this example the Grabbiter's horizontal direction is being set to -1 (Left.)
|Patch: Keen 6|