This page contains patches that relate to the Mangling Machine in Keen 3. The machine is made of eleven sprites, six purple sparks, one heart, two 'arm' sprites and two 'leg' sprites, and is found in level 16 of Keen 3.
When Keen enters the level a sound plays and a series of text boxes appear. (The conversation with Mortimer McMire.) Keen must shoot the six spark sprites, after which the arm sprites will be destroyed. Then Keen must destroy the heart sprite to destroy the machine and all sprites in the level, winning the game.
How the machine works
The 'Mangling Machine' is not one entity, but a number of things placed together and can even be said to be the level itself. The components do not have to be arranged in the way they are by default (Which is a humanoid blue machine.) and many can be left out.
There are three basic components to the machine. The first are the arm and leg sprites; invisible sprites that move tiles around making the machine appear to move. The second are the purple sparks, when enough have been destroyed the arm sprites and their tiles are also destroyed. The third is the heart which wins the level when destroyed. All the other things in the level are just added to make things harder for Keen. (Such as the Meeps.)
There are two things that can be disabled; the first is the sequence of Mangling Machine text boxes, if this is disabled Keen can still win the game by destroying the Mangling Machine. The second patch removes the 'win game' sequence, so, by default there is no way to win the game at all. The Mangling Machine text sequence will still play. The following section is also helpful.
|Patch: Keen 3|
|Patch: Keen 3|
Mangling Machine level
This is the level where the conversation with Mortimer occurs and which will win the game if it is completed. If the Mangling Machine is placed in other levels it will be destroyable but will lack the conversation. (And Keen will just win the level when he destroys it, not the game.) by default this level is level 16.
|Patch: Keen 3|
Mortimer McMire conversation
These patches relate to the series of text boxes that appear when Keen enters the MM level. There is also an impressive sound played when the level starts.
Spark counter reset in Mortimer conversation window
When the Mortimer McMire conversation window plays,t he number of sparks shot is set to 0. This means that this value is only reset at the start of level 16 by default. See Patch:Purple spark and Patch:Game stats.
|Patch: Keen 3|
Level entrance sound
This is the sound played when the conversation with Mortimer begins.
|Patch: Keen 3|
Text box centering
the text boxes in this conversation are 'centered' around at a certain height on the screen. This means the text boxes cannot be placed all over the screen, they must all be centered around a certain vertical height. There are two values used, one for most of the boxes (That are small and thus towards the bottom of the screen.) and one for Mortimer's lengthy replies (Which are taller and thus higher up the screen.) The position of the first text box can be seen in the image above.
|Patch: Keen 3|
Text box size and text
Each text box has five patches associated with it; the height, the width, the time it remains onscreen (to be read), where the text is read from and the text itself. The page Patch:Text patches is useful for patching these things as it explains the text patch format. Here each window is shown in sequence, from first to last.
The height and width of the window are in text squares (Lines or letters) A 1x8 window can contain one line 8 characters long. The time onscreen value is in 144ths of a second, the default time is shown in the patch. All values below are the default ones.
It is also possible to completely remove some text boxes from appearing, making the conversation simpler. A small utility to make entirely custom conversations can be downloaded here: https://dl.dropboxusercontent.com/u/3940020/MORTEXT.zip
|Patch: Box 1 (No) patches|
|Patch: Box 2 (Can't be) patches|
|Patch: Box 3 (MORTIMER!) patches|
|Patch: Box 4 (Thorn in side) patches|
|Patch: Box 5 (Swirlies) patches|
|Patch: Box 6 (All right) patches|
|Patch: Box 7 (All right) patches|
|Patch: Box 8 (I'll get you) patches|
|Patch: Box 9 (Come and try) patches|
Heart, Spark, Arms and Legs
Most of the patches relating to the shootable sprites can be found on the Patch:Heart and Patch:Purple spark pages. The arm and leg sprites are entirely tile based., thus most of the patches for them will involve what tiles are placed and where.
Although the arms and legs seem to 'grow' and shrink, in reality the sprite is moving, leaving tiles as it goes, much like the Patch:Falling block in Keen 1. Thus tile locations will always be relative to the moving sprite. Arms and legs stop moving when they hit a 'stop tile'; they will easily move right through solid ground if it is the wrong type of tile, and right out of the bottom of the level.
Sparks and Heart
These patches control the amount of points Keen gets when he shoots a spark or heart, and the number of sparks needed to be destroyed before the arm sprites are destroyed. (For the meaning of the $75 byte see Patch:Jump conditions) See also Patch:Heart and Patch:Purple spark. By default Keen gets 1'000 points for shooting either.
|Patch: Heart and spark patches|
There are two arm sprites, one on either side of the MM by default. Their job is to shield the heart sprite so Keen can't win the level in a single shot. Unlike the legs, both arm sprites are the same, just in different locations, so patching one affects both of them the same way. Arms can thus be placed anywhere in the level, and many may be used.
The arm's center is the tile between the top of its 'fingers' and all other tile positions are relative to this. Some tile positions can be changed, some can't. If two tiles are patched to the same place, only one will appear. An easy way to make a tile 'not appear' is to make it the same as the background tiles. If you really want to stop a tile being replaced make sure both it and its 'replacement tiles' are stopped.
The 'stop' or 'floor' tile will stop the arm when it is two tiles below it. For the meaning of the $75 byte see Patch:Jump conditions; it is possible to make a large number of tiles floor tiles. (By changing the $75) to make a more versatile machine.
Like the legs the arms move down until they hit a stop tile, then move back up to until they run out of arm tiles. (Thus you need to place your arm sprite ON an arm tile to make it work properly.) If the arm sprite is not placed on an arm tile then it will not rise after it falls, this can be used deliberately to 'lock Keen in' someplace. As they move they leave tiles behind, both solid, and 'wallpaper.' The best way to figure out how the arms work is to experiment with patching.
The arm consists of the arm itself, and two fingers, left and right. It is possible to change how fast the arm moves.
|Patch: Arm speed|
|Patch: Arm tile patches|
The legs consist of two parts, the leg and the foot. Left legs and right legs are different sprites (Though they DO share some code!) and there is one of each by default. They are at the bottom of the MM and try to kill Keen by putting deadly-type tiles on him. (The legs are not in themselves lethal, the tiles are.) They move up and down until there is a 'stop' or 'floor' tile beneath them, like the arms.
The center of the leg is where the foot meets the leg. For the left leg the floor tile must be one to the right of it, for the right leg this tile must be 1 tile to the left. (In the default level they are the same grey block, between the legs.) Like the arms, the $75 byte can be changed to allow multiple types of tile to act as floor tiles.
While both legs use the same *leg* tiles, they can use different foot tiles. Leg sprites must be placed on a leg tile. If the leg start tile is not the same as the leg tiles, then the foot will not rise after it has fallen. This can be used to 'trap' Keen someplace.
It is notable that the left leg will rise first after it has landed, even if it has landed at the same time as a right foot. The leg speed is odd, it is 0 by default (So the legs can't be made slower) but making it larger speeds the legs up. (Good values are 0040 and 0080)
|Patch: Leg rising|
|Patch: Leg tile patches|
The destruction of the Mangling Machine
There are two events of destruction involved with the MM. The first is the destruction of the arms. First the arm sprites are removed, then two areas of the level are replaced with background tiles, erasing the arm tiles. The second is the destruction of the heart, ALL sprites in a level are removed, another area of the level is replaced with background tiles and Keen wins the level (Or game.)
These can be used in normal levels too, they do not need the MM sprites to work. (Just the sparks or heart.)
All Sparks destroyed
The first destructive event will remove arm sprites. The 'destruction zones' are not related to the arm sprites AT ALL, they can be in totally different places/ Any arm sprites not in the two 'destruction zones' will simply stop; any tiles in the destruction zone, whatever they are, will be destroyed. The level does not even need arm sprites in it to use this destruction, just enough sparks.
When a tile is being destroyed it will have a Patch:Zap and zot sprite placed over it. (See that page for more patches.) If that sprite is changed it is possible to make the destroyed arms produce dozens of Vorticons say, a scary prospect. Certain tiles are not replaced, by changing the $74 byte to $EB the destruction zone is not affected at all. (You can also be more inventive and have multiple tiles not replaced, allowing some parts of the level to survive.
Below the two destruction zones will be called 'left' and right'. They can be placed anywhere in a level, even outside it. (In which case nothing in the level will be harmed.)
The 'move down x rows' patch changes how many rows the destruction moves down each turn. By default this is one row, so row 1 is destroyed, then row 2, then 3... but this can be made larger, destroying only every second or third row for example.
The h and v values for the location of the destruction zones are 2 less than they appear in the level because of the level border.
|Patch: Arm destruction zones|
|Patch: Misc destruction zones patches|
This is the final destructive sequence, another tile replacement zone, by default destroying the MM entirely. ALL sprites are removed from the level and the level is won. This works very similarly to the arm destruction sequence, so that too should be read.
It is also possible to patch how long it takes before the level is won. Changing the $75 byte to $EB means Keen cannot win the level by destroying the MM.
|Patch: Body destruction zone|
Winning the level
There will be a pause of a certain length before the level is won. The length of this can be changed, or it can be removed entirely, meaning that destroying the heart will not in fact win the level.
|Patch: Time after starting destruction that Keen wins the level|
Don't win the level
This patch stops Keen winning the level even if he destroys the heart. he will need to find an exit instead.
|Patch: Destroying the Heart doesn't win the level|
Misc patches that don't really fit anywhere else.
Destroying sparks destroys part of MM, wins level
This patch is slightly unstable and may have unforeseen effects.
|Patch: Destroying sparks destroys part of MM, wins level|
- A small utility for making custom Mangling Machine conversations: https://dl.dropboxusercontent.com/u/3940020/MORTEXT.zip