Page 1 of 1

ARTICLE: Modding teleporters in Keen 1

Posted: Mon Sep 01, 2003 12:50 am
by adurdin
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:

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
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:

Code: Select all

Destination Number    X Offset    Y Offset
       1              $158DF      $158E3
       2              $158E9      $158ED
       3              $158F3      $158F7
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:

Code: Select all

%ext ck1
%version 1.31

%patch $158E9  $40 $02
%patch $158ED  $50 $00

%end
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:

Code: Select all

Teleporter Style    Main Tile    Animated Tiles
     Snow              99           342-345
     Dirt             325           338-341
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.

Posted: Mon Jan 26, 2009 11:12 pm
by Fleexy
This isn't working for me. My coordinates are X: 40, Y: 15 for teleporter 1 and X: 28, Y: 6 for teleporter 2 given by Mindbelt. I can't get them to work. Any suggestions?

--Fleexy

Posted: Tue Jan 27, 2009 3:57 am
by CommanderSpleen
That is a new record for an epic bump. 5.5 years.

Firstly, define "not working", and explain exactly what you've done so far. Then we can help.

Posted: Tue Jan 27, 2009 6:52 am
by XkyRauh
Thirdly, make sure you check out the info post, detailing that this is not a request/help forum. Please move discussion of this issue into the Requests forum.

:) Pretty epic bump.

Posted: Tue Jan 27, 2009 8:43 pm
by KeenRush
We've been here for more than half a decade? :\ Shit. :D Wow.

Posted: Fri Feb 13, 2009 12:16 am
by adurdin
Wow, yeah. The earliest post is from 30th August 2003, 7:29pm Australian Eastern Time.

Doesn't time fly!

Posted: Fri Feb 13, 2009 4:56 am
by CommanderSpleen
It's been an incredibly eventful 5+ years for me, so fortunately I can't say it's 'flown' as such. But it is mindblowing to think how long the place has been here and what a tight-knit community it's become.

Posted: Fri Feb 13, 2009 10:32 am
by levellass
Indeed, and look at the progress and all we have done! It brings a tear to the eye it does.

Posted: Fri Feb 13, 2009 2:44 pm
by CommanderSpleen
Might almost be time for some kind of celebration of longevity!

Posted: Sat Dec 12, 2009 6:19 pm
by gerstrong

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 
Hello, I imagine that works great with mods, but there is something I don't understand.

The original map has the sprite numbers (dec) 38, 41 and 46. The 46 would fit best to that table as it uses dirt, but the other two are snow (not in the table). I imagine that you can use more teleporters.

I really would like to know which other teleporters are snow or dirt. There must be a range.