BUILDING QUESTION: Those bridges in Keen 1.. :)

Request patches for Keens 1-3.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Guess what people?
I got it working, cheers to MultiMania! :)
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

re: FE05

Post by XkyRauh »

Alright, so putting switches above and to the left of our bridges is ideal, simply because that way we get to use positive numbers for locating things (like $H0305 for a bridge that is 3 tiles down and 5 tiles right of our switch)... But for those of us who are foolish and construct our levels with the switches below and to the right of our bridges, we need to work with negative numbers. Forgive my n00bishness here: FE is -2... would FF be -1 and FD be -3, then, and so on? or is it more complex than that?

Thanks!

--Xky
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Hey, just guess, the answer will soon become apparent. Myself I use sprites with values like -1024 (I'm hex editor influent.)
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

re: HEX

Post by XkyRauh »

Yeah, my guess was correct... FF is -1, FE is -2, and so on... so -20 would be EC.

HEX isn't horribly hard to understand, it just takes a while. The really hard stuff is the assembly language Durdin swims through for us! ;-)

--Xky
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Post by ckguy »

I wrote a little program where you input the switch location and bridge location, and the program outputs the sprite number.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Sounds like an useful program. :) I'm thinking I could someday write some stuff like that (I mean those number-converters) and upload them to web, so they could be easily accessed.
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Ooo! Ooo! What program? Where? Gimme gimme gimme!
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

He hasn't posted it yet. :) But pretty useful, I have to use my Windows calculator. :D
User avatar
ckguy
Posts: 465
Joined: Tue Oct 14, 2003 11:20 am
Location: Wakefield, RI, US
Contact:

Okay, here goes ...

Post by ckguy »

Hmmm! I wasn't expecting this kind of response!

Anyway, I wrote the program on my graphing calculator (I've got a TI-85), and not in, say, QuickBasic so I didn't have to switch over to the program while editing.

The following QB code was written just now as I'm making the post:

Code: Select all

'vars default to long integer
deflng a-z
cls
print "The CK Guy's Commander Keen Bridge Sprite Helper"
'get info
input "Switch X, Y"; x1, y1
input "Bridge X, Y"; x2, y2
'find offsets
xoff = x2 - x1
yoff = y2 - y1
'if less than zero, add 256
if xoff < 0 then xoff = xoff + 256
if yoff < 0 then yoff = yoff + 256
sprite = xoff + yoff * 256
'output
print "Use sprite # hex "; hex$(sprite)
'now, this next bit is kind of confusing.  In Andy's KeenWright (dos version) when you enter a sprite number, it has to be a short integer.  Short integers go from -32768 to 32767.  So, if sprite is from 32768 to 65535, we must subtract 65536 from it.  Got that? ;-)
if sprite > 32767 then sprite = sprite - 65536
print "Or, in KeenWright, # ";sprite
I hope that code works.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Calculator! There's an answer! Why I haven't thought that before, the converting would be a lot easier with my T-86(??) calculator than with some annoying Windows calculator!
I'll test that code tomorrow - and if you give me permission I could change it to php-form later.. :) Anyways, good job!
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

..

Post by xtraverse »

Here's a version done in Javascript:

http://spatang.com/ck/calc.php
User avatar
grelphy
Posts: 219
Joined: Fri Sep 05, 2003 12:41 am
Location: the Armageddon Machine

Post by grelphy »

Dang, you got the jump on me - I converted it to VB. =P

Anyway, here's my version: http://grelphy.spatang.com/bridgecalc.zip

Anyway, what a great development!
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Yeah! Cool jobs there!
Well, I'll convert it to php and add to my site.. :D
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Wow! nice work.

One point though, while waiting for you to write this program I wrote my own in the inferior language of BASIC, it says that the sprite value to make a switch a bridge (i.e act as if there was no sprite there.) is -512 Your program suggests -256 (which is wrong.)

Your program works however with most other sprite values, but I have had some problems (Keen moves but the screen don't.)

I have noticed your program always produces somewhat large sprites (-18427 vs -6907 for my program.)

Am I using your program incorrectly? Does it matter which version of Keen you have (1.31)? Why do both sprite values from each program work even though they have different values?
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

Post by xtraverse »

Whose program are you talking about? Three or four have already been posted.
Post Reply