ARTICLE: Modding teleporters in Keen 1

Completed patches for Keen1.
Post Reply
User avatar
adurdin
Site Founder
Posts: 546
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

ARTICLE: Modding teleporters in Keen 1

Post by adurdin » 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:

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.

User avatar
Fleexy
Site Admin
Posts: 472
Joined: Fri Dec 12, 2008 1:33 am
Location: Blogham Tower
Contact:

Post by Fleexy » Mon Jan 26, 2009 11:12 pm

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

User avatar
CommanderSpleen
Posts: 1014
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen » Tue Jan 27, 2009 3:57 am

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.

User avatar
XkyRauh
Posts: 1112
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

Post by XkyRauh » Tue Jan 27, 2009 6:52 am

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.

KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush » Tue Jan 27, 2009 8:43 pm

We've been here for more than half a decade? :\ Shit. :D Wow.

User avatar
adurdin
Site Founder
Posts: 546
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin » Fri Feb 13, 2009 12:16 am

Wow, yeah. The earliest post is from 30th August 2003, 7:29pm Australian Eastern Time.

Doesn't time fly!

User avatar
CommanderSpleen
Posts: 1014
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen » Fri Feb 13, 2009 4:56 am

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.

levellass
Posts: 2841
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass » Fri Feb 13, 2009 10:32 am

Indeed, and look at the progress and all we have done! It brings a tear to the eye it does.

User avatar
CommanderSpleen
Posts: 1014
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen » Fri Feb 13, 2009 2:44 pm

Might almost be time for some kind of celebration of longevity!

gerstrong
Posts: 63
Joined: Sun Jan 25, 2009 3:21 pm

Post by gerstrong » Sat Dec 12, 2009 6:19 pm

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.

Post Reply