REQUEST: Keycard tile collision calls level exit

Request patches for Keens 1-3.
Post Reply
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

REQUEST: Keycard tile collision calls level exit

Post by CommanderSpleen »

Currently I've patched keycards to turn into level exit tiles that look like the background when collected. But as you have to jump to collect the keycards, sometimes it's possible to just miss the exit tile as it spawns. You can still exit by jumping back to the same spot but it is untidy.

Can we cut out the middle man and just exit the level after adding the keycard to the inventory?
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Well now, there are three ways we can do this. The first is simply to link the two tile codes, when Keen touches a keycard he gets it, it vanishes, the exit sound plays:

Code: Select all

#Keycards call exit code after got
%patch $4529 $A8

Of course Keen still can't exit in the air because of a behavior check. The second route makes Keen do the 'exit walk' when he gets a keycard. This time the keycard sound, not the exit sound, plays and Keen can walk in midair:

Code: Select all

#Keycards make Keen exit walk when got
%patch $4529 $BC

The third route is simply to win the level when Keen gets the card. Doing this causes the level to pause briefly then Keen wins. (The pause depends on how long the keycard sound is.) The keycard doesn't vanish, but if desired that can happen too with a slightly more complicated patch:

Code: Select all

#Keycards make Keen win the level when got
%patch $4513 $C7 $06 $6C60W $0001W  $EB $5C
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

None of these seem to be having any effect. The keycard just disappears normally and the level goes on.

Perhaps some other patch is interfering. I'll try it on a fresh copy of Keen 1.

Edit: Yup, seems to be something interfering. Ran fine pasted into XkyKeen1.

Editit: Putting it at the end of the patch file is go. Time will tell what that breaks...
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Quite possibly it's the old keycard patch. Do you have the patchfile or the dump file (For when things *don't* work.) I can scan them for conflicts.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

splsplspl wrote:Editit: Putting it at the end of the patch file is go. Time will tell what that breaks...
Think I may have found what it breaks. Had the music patch deactivated since around the time of this thread, and have just re-enabled it to find the game hangs at the end of the level fade out upon level exit via keycard. (Music TSR happily continues playing in the background.)

Hard to say if it is directly related, as a lot of small changes have taken place in the patch file since then. I will experiment with normal level tiles and see if exiting a level in that manner causes the same problem.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Curious. There are multiple options so we should hopefully be able to do a workaround.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

I've been patching out sections of the patch, starting with the music TSR, and the hang still happens. Seems to be the exit process itself as the exit tile (sans exit walk) has the same effect as the keycard after the keycard exit patch has also been commented out. Will have to recongeal the patch file from scratch to figure out the culprit.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

This appears to be the problem. Deleting it is the point at which level exiting becomes functional again.

Code: Select all

#Complete the game when level 16 is done:

%patch $8022 $AAC4W $00 $C4 #The byte C4 sets a win condition to level 16, level
%patch $8029 $AAC4W $00 $C4 #15 is C2, etc. For the 32 levels patch use B5 with
%patch $8030 $AAC4W $00 $C4 #level 15 as B4, etc. This patch means you can have
%patch $8037 $AAC4W $00 $C4 #up to four levels as winning conditions
I am currently relying on this patch, so hopefully there's a reasonably simple workaround.

Edit: Redoing this patch from the KeenWiki instead of wherever I got that one sets everything right again. Testing with level 4 as the ending trigger can has succeed. Looks like I may have misunderstood the comments at the time, setting the $74 to $C4 instead of the $AAnn gamestats part.

Code: Select all

#What we need before we can win: (Default: win if all 4 NOT 0)
%patch $8022 $AAACW $00 $74 #Level 4
%patch $8029 $AAACW $00 $74 
%patch $8030 $AAACW $00 $74 
%patch $8037 $AAACW $00 $74 
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

It's always nice to see issues resolved. Feel free also to add notes on the wiki for difficult to understand stuff.
Post Reply