Keen 2: "new enemy"

Request patches for Keens 1-3.
Post Reply
User avatar
szemigi
Posts: 716
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Keen 2: "new enemy"

Post by szemigi »

Well, I want a "new" enemy for Keen 2.


Instructions:

This enemy is

not deadly to touch
it doesn't move, just stands
if Keen touches it, it pushes you back (like the Yorp in Keen 1)
it can shoot ONLY to the right
it can shoot Keen's blue charge and the Guard Robot's/Vorticon Elite's red charge, but this enemy does it randomly: so sometimes it shoots red charge, sometimes it shoots blue (of course, Keen dies if this enemy shoots him randomly with red or blue charges)
and not least this enemy is immortal

Sprite for it:

2SPR0073.BMP - the unused YAWN sprite -> it'll be the new enemy's sprite
2SPR0122.BMP - blue charge
2SPR0123.BMP - red charge


Note: I'm using the Mindbelt Keen 1-3 level editor, so if you can make the new enemy patch, let me know what is the sprite number of this new enemy.


And don't ask back. I'm surely I want it like this. :)
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Keen 2: "new enemy"

Post by levellass »

There are two big limits to this enemy. The first is that in Keen 2 there is no Yorp-pushing behavior, so the enemy just blocks Keen like the Scrub or Platform. The second is that Keen's blue shot always shoots the way he is facing, so this enemy will NOT shoot blue shots if Keen is facing left, only red ones. This cannot be changed. Everything else works fine. It was a big request though.

Code: Select all

#Regularized Keen 2 spawning code
%patch $3B35 $81 $FB $00FFW  $74 $69 $4B $83 $FB $07 $76 $03 $E9 $0084W  $D1
             $E3 $2E $FF $A7 $3B83W
%patch $3B4B $57 $56 $E8 $009AW  $EB $4D $57 $56 $E8 $00F5W  $EB $46
             $57 $56 $E8 $0150W  $EB $3F $57 $56 $E8 $01ABW  $EB $38
             $57 $56 $E8 $01E1W  $EB $31 $57 $56 $E8 $0221W  $EB $2A
             $57 $56 $E8 $0262W  $EB $23 $57 $56 $E8 $CF71W  $EB $1C
%patch $3B83 $3B4BW  $3B52W  $3B59W  $3B60W  $3B67W  $3B6EW  $3B75W  $3B7CW

#New sprite spawn, immortal, blocks
%patch $0AF2 $55 $8B $EC $56 $E8 $4C7EW  $8B $F0 $C7 $04 $0007W  $8B $46 $04
             $99 $B1 $0C $E8 $CD79W  $89 $44 $04 $89 $54 $06 $8B $46 $06 $99
             $B1 $0C $E8 $CD6AW  $89 $44 $08 $89 $54 $0A $C7 $44 $32 $0B34W
             $C7 $44 $34 $4677W  $C7 $44 $20 $0010W  $C7 $44 $28 $0049W  $5E
             $5D $C3

#New behavior, randomly shoot red and blue shots
%patch $0B34 $55 $8B $EC $56 $E8 $ACABW  $8B $16 $5AF0W  $D1 $E2 $3B $C2 $73
             $38 $E8 $AC9EW  $8B $16 $2FC2W  $D1 $E2 $3B $C2 $73 $2E $B8 $0026W
                 $50 $E8 $AAB2W  $44 $44 $BE $015EW  $56 $A1 $96CAW  $8B
             $16 $96C8W  $81 $C2 $FF00W  $15 $FFFFW  $50 $52 $FF $36 $96C6W
             $FF $36 $96C4W  $E8 $6AC3W  $83 $C4 $0A $5E $5D $C3 $83 $3E $6028W
             $00 $7C $CB $B8 $000CW  $50 $E8 $AA7DW  $44 $44 $FF $36 $96CAW
             $FF $36 $96C8W  $FF $36 $96C6W  $FF $36 $96C4W  $E8 $6876W  $83
             $C4 $08 $5E $5D $C3

#Change shot collisions to respect platform types
%patch $7677 $75C5W
%patch $75BD $83 $3D $07 $74 $27 $E9 $01B4W
%patch $75C5 $55 $8B $EC $56 $57 $8B $76 $04 $8B $7E $06 $83 $3D $06 $74 $14
             $83 $3D $0D $74 $0F $83 $3D $04 $74 $0A $83 $3D $07 $74 $05 $E9
             $0192W  $90 $90
Last edited by levellass on Thu Dec 14, 2017 3:05 am, edited 1 time in total.
User avatar
szemigi
Posts: 716
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Re: Keen 2: "new enemy"

Post by szemigi »

But what is the sprite code number in the Mindbelt for the new enemy? Since I told I'm using Mindbelt. Is it after 255 (Commander Keen) or what? This is important, because I wanna keep on level making and I have no time for search for the code (especially if I don't know what the sprite code is for the new enemy.)

Another question: In the patch which value handles the sprite of the new enemy? Because as I said, 2SPR0073 is the sprite for the new enemy.


EDIT: Instead of 2SPR0073 I can see 2spr0016. Why?

Also, I'm using a '$0AF2 patch' (the extra frame for unstunning that you made me before + the new enemy patch that also uses $0AF2). Then they interfered each other? I hope not.

Oh, and please answer everything.

***

EDIT 2: I tested and both I mentioned uses "$0AF2". New enemy patch interfered the extra frame for unstunning patch: the game crashed when Keen stood up from the ground. I'm deadly serious.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Keen 2: "new enemy"

Post by levellass »

Surely you must know the code is 8, the next one after the last sprite.

Yes the 0AF2 patch interferes, so there will need to be a modification of this one to fit both.

The value of the sprite that should appear is $0049W in the end of the second paragraph of code. If you're having problems try re-copying the patch from here; there seems to be a small problem when copying off of this webpage that can sometimes mess the patch a bit.


This modifies the stun patch so it won't interfere:

Code: Select all

#Extra frame when unstunning -Keen 2 -modified for new sprite stuff
%patch $4A5B $0BA9W
%patch $0BA9 $55 $8B $EC $C7 $06 $96E8W  $001EW  $A1 $96EAW  $03 $06 $5AF0W
             $A3 $96EAW  $3D $0014W  $7E $06 $C7 $06 $96F2W  $66A9W  $5D $C3
Post Reply