A Vortikid patch (CK2)

Request patches for Keens 1-3.
Post Reply
Darziw Nogaj
Posts: 22
Joined: Fri Feb 07, 2014 1:25 am

A Vortikid patch (CK2)

Post by Darziw Nogaj »

Is it possible for a patch that makes the Vortikid turn around when they reach a cliff (like the Butler Robots in Keen1)? Quinton would like to have that patch for his "The Reezy Army" trilogy.
User avatar
troublesomekeen
Posts: 223
Joined: Fri Feb 03, 2012 7:56 pm
Location: Shadowlands
Contact:

Re: A Vortikid patch (CK2)

Post by troublesomekeen »

Patches like this for Keen 2 obtusely "tricky." I wonder if it wouldn't be easier to make the Butler Bot act like the Vortikid.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Oh boy is that tricky; because they can jump they'd be able to jump off of edges making the patch far less effective. Making them turn if they happen to be running up to an edge may be possible but still very tricky indeed.
Darziw Nogaj
Posts: 22
Joined: Fri Feb 07, 2014 1:25 am

Post by Darziw Nogaj »

levellass wrote:Oh boy is that tricky; because they can jump they'd be able to jump off of edges making the patch far less effective. Making them turn if they happen to be running up to an edge may be possible but still very tricky indeed.
Quinton changed their jump height into 1 and they don't seem to be jumping at all, if they are still jumping though, a patch for them not being able to jump would be nice.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Code: Select all

#Vortikid never jumps
%patch $4008 $EB
If you're using no jumping I can try my best to whip up a turning patch. Tell me, do you have any patches using the $0AF2 address?
Darziw Nogaj
Posts: 22
Joined: Fri Feb 07, 2014 1:25 am

Post by Darziw Nogaj »

Nope, no patches that use the $0AF2 address.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

People need to remind me of these things or they never get done.


This patch causes Vortikids to turn at edges instead of jumping. (Jumping is possible but makes things more complicated.) The first line causes Vortikids to fall when they first spawn. This is required because Vortikids spawn in the air.

The second section replaces the jumping code with turning code. When the Vortikid is not touching a floor it is given a slight upward boost ($FFF2W to counteract gravity.), its timer is set to 0 (For timing its turning.) and its action to 'turn'. A check is then made of the Vortikid's speed and it is reversed. (If moving left, go right, if right, go left.) This is also part of the 'hit walls' code.

The third section is the turning code itself using unused space at $0AF2. This checks the Vortikid's speed and sets the turning animations. (Here the same as the falling animations.) There are three tile checks. The first checks for floors; if the Vortikid is back on a floor it returns to walking. The next two are walls; the Vortikid will bounce off of walls.

On line 5 a timer is checked; after 14 ticks of turning the Vortikid will go to falling. This happens if the Vortikid somehow finds itself in the air, such as if a bridge is removed from beneath it. The speeds of the Vortikid are $FF06W (Left.) and $00FAW (Right.) These are set in both the second and third sections.

Code: Select all

#Vortikids fall to ground when spawned
%patch $3C7A $404CW

#Vortikids turn at edges instead of jumping
%patch $4008 $E8 $1A61W  $E8 $1AA1W  $8B $F0 $A9 $02 $00 $75 $1B $C7 $06 $96E2W
                 $FFF2W  $C7 $06 $96EAW  $0000W  $C7 $06 $96F2W  $0AF2W  $83
             $3E $96E0W  $00 $7D $08 $EB $12 $F7 $C6 $04 $00 $74 $06 $C7 $06
             $96E0W  $FF06W  $F7 $C6 $01 $00 $74 $06 $C7 $06 $96E0W  $00FAW
             $5E $5D $C3

#Turning behavior, bounce off walls, walk on ground fall in air
%patch $0AF2 $55 $8B $EC $56 $83 $3E $96E0W  $00 $7E $08 $C7 $06 $96E8W  $0037W
                 $EB $06 $C7 $06 $96E8W  $0033W  $E8 $4FA1W  $8B $F0 $A9 $02
             $00 $74 $06 $C7 $06 $96F2W  $3FCCW  $F7 $C6 $04 $00 $74 $06 $C7
             $06 $96E0W  $FF06W  $F7 $C6 $01 $00 $74 $06 $C7 $06 $96E0W  $00FAW
                 $A1 $96EAW  $03 $06 $5AF0W  $A3 $96EAW  $3D $0014W  $7E $06
             $C7 $06 $96F2W  $404CW  $5E $5D $C3
Post Reply