ARTICLE: Modding teleporters in Keen 1
Posted: Mon Sep 01, 2003 12:50 am
This post describes how to mod the teleporters in Keen 1 v1.31
Teleporters are indicated on the map level with a sprite number in the range $20 - $2F. This number gives both the teleporter style (on snow or on dirt) and the destination number. You can have three teleporter destinations, numbered 1, 2, and 3. (You can have as many teleporters as you want, but they can only take you to three places)
Teleporter Sprite Numbers:
The destinations to which the teleporters take Keen must be patched in the .exe. For each destination, you must patch the X and Y coordinates. In KeenWright, the level coordinates are given starting at -2, so to find the true X and Y coordinates you must add 2 to the number given by KeenWright. Multiply each by 16, and convert the result to hex; then split the number into two two-digit hex numbers. The bytes to patch will be the second of these followed by the first of these.
For example, suppose you want to make a teleporter to take Keen to X:34, Y:3 (as given by KeenWright). The true coordinates are X:36, Y:5. Multiplying by 16 and converting to hex gives X:$240, Y:$50. Converting these each to a pair of two-digit numbers gives X: $02 $40, Y: $00 $50. So to patch the X location, we'd use the bytes $40 $02, and for the Y location we'd use $50 $00. Clear? The offsets to patch are given in the table below:
Teleporter Patch Offsets:
So in the example above, if it was destination 2 that we were wanting to change, we'd have the following in our .pat file:
The two different teleporter styles use different tiles for the teleporter. These can be modified if you want to change how the teleporters look:
Teleporter Tile Numbers:
Finally, tiles with the "Teleporter" behaviour (481-484 and 494-497 by default in Keen 1) act as a teleporter when used in a level. These will always take Keen to destination 3.
Teleporters are indicated on the map level with a sprite number in the range $20 - $2F. This number gives both the teleporter style (on snow or on dirt) and the destination number. You can have three teleporter destinations, numbered 1, 2, and 3. (You can have as many teleporters as you want, but they can only take you to three places)
Teleporter Sprite Numbers:
Code: Select all
Sprite Number Teleporter Style Destination Number
$21 (33) Snow 1
$22 (34) Snow 2
$23 (35) Snow 3
$2D (45) Dirt 1
$2E (46) Dirt 2
$2F (47) Dirt 3
For example, suppose you want to make a teleporter to take Keen to X:34, Y:3 (as given by KeenWright). The true coordinates are X:36, Y:5. Multiplying by 16 and converting to hex gives X:$240, Y:$50. Converting these each to a pair of two-digit numbers gives X: $02 $40, Y: $00 $50. So to patch the X location, we'd use the bytes $40 $02, and for the Y location we'd use $50 $00. Clear? The offsets to patch are given in the table below:
Teleporter Patch Offsets:
Code: Select all
Destination Number X Offset Y Offset
1 $158DF $158E3
2 $158E9 $158ED
3 $158F3 $158F7
Code: Select all
%ext ck1
%version 1.31
%patch $158E9 $40 $02
%patch $158ED $50 $00
%end
Teleporter Tile Numbers:
Code: Select all
Teleporter Style Main Tile Animated Tiles
Snow 99 342-345
Dirt 325 338-341