My Robo Red stunned patch is causing game crash

Request patches for Keens 4-6.
Post Reply
User avatar
loop4ever
Posts: 18
Joined: Sun Jan 06, 2019 10:37 pm

My Robo Red stunned patch is causing game crash

Post by loop4ever » Tue Mar 19, 2019 7:12 pm

I had initially thought that everything was perfect, but after using the stun patch on the Robo Red I noticed that for some strange reason when keen makes contact with Robo Red the game crashes. All I tweaked on the stun patch was the animation used which worked perfectly. Also I'm sure it's this patch that's causing the game to crash because when I remove it the game works perfectly without crashing.

here are my Robo Red patches:

Code: Select all

###################################################################
                      #Robo Red#
###################################################################


#New collision: Robored stun
%patch $1264D $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D $02 $75 $09
              $9A $0B8013E9RL     $5F $5E $5D $CB $83 $3D $03 $75 $18 $C7 $44
              $16 $0000W  $C7 $44 $06 $0001W  $B8 $00F2W  $50 $57 $56 $9A $090B16CDRL
                          $83 $C4 $06 $5F $5E $5D $CB


#New action: Robored stunned 
%patch $30432 $0188W $0188W $0002W $0000W $0000W $0000W $0000W $0000W
              $090B1710RL   $00000000L    $090B195ARL   $0000W


#Tweak right position of Red's rightwards shots
%patch $126BD $0125W # '0080' = 0.5 tiles right

#Red's shots only move horizontally
%patch $126EE $C7 $47 $18 $0000W $EB $10

#Number of shots
%patch $12643 $0001W #When Keen lands near Red (1)

#Red shoots randomly no matter where Keen is
%patch $12603 $EB $19
%patch $12624 $0010W


#Red's smashed shots
%patch $32B44 $0000W #Robo Red shot smash 1(Vanish so only seen when stunned)

#Move back after shooting
%patch $12718 $0000W #Facing right  
%patch $1271D $0000W #Facing left # (To prevent jiggle)

#Red can't be lured off ledges
%patch $32ABC $0000W
%patch $12711 $5F $5E $5D $CB

55Aavenue
Posts: 16
Joined: Wed Apr 04, 2018 7:19 pm

Re: My Robo Red stunned patch is causing game crash

Post by 55Aavenue » Wed Mar 20, 2019 1:29 am

Does it give an error message when it quits? And is it crashing when keen touches stunned robo red or normal robo red?

User avatar
loop4ever
Posts: 18
Joined: Sun Jan 06, 2019 10:37 pm

Re: My Robo Red stunned patch is causing game crash

Post by loop4ever » Wed Mar 20, 2019 2:51 am

Does it give an error message when it quits? And is it crashing when keen touches stunned robo red or normal robo red?
1: No it doesn't give an error message, the game just freezes and stops working.

2: It only happens when keen touches the normal robo red. When keen touches the stunned robo red the game goes on smoothly with no problem.

I'm thinking the patch is defective. If it helps I think this is the original post where this patch was made viewtopic.php?f=24&t=1873

55Aavenue
Posts: 16
Joined: Wed Apr 04, 2018 7:19 pm

Re: My Robo Red stunned patch is causing game crash

Post by 55Aavenue » Wed Mar 20, 2019 5:06 am

I couldn't get that wiki patch to work either, but I did figured out another slightly different way you could achieve the same goal of robo red being stunable:

Code: Select all

#New robo red collision: stunnable (changes to new sprite), kills keen
%patch $1264D $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D $02 $75 $09
             $9A $0AAF1517RL     $5F $5E $5D $CB $83 $3D $03 $75 $18 $C7 $44
             $16 $0000W  $C7 $44 $06 $0001W  $B8 $1EB2W  $50 $57 $56 $9A $090B16CDRL
                         $83 $C4 $06 $5F $5E $5D $CB

#robo red always uses above collision code
%patch $32AA6 $11C40A0DRL #Pause before shooting
%patch $32AC4 $11C40A0DRL #Pause between shots
%patch $32AE2 $11C40A0DRL #Shoot
Value $1EB2W is a sprite action robo red will turn into when shot. In this example he turns into the pink shot smashed sprite (what you see when the pink bullets from the guns hit a wall before they dissapear) so it will look like robo red explodes into a small pink blast. However you must have a pink gun shooting somewhere in the level so this sprite action frame caches or game will crash. You can experiment with having him turning into other frames. You could also sacrifice a stunned frame from another sprite in the game and modify the graphics of it to make your own robo red stunned graphic if you wanted. I also tested this patch using $3168W which turns him into a stunned korath (but this would assume you change the graphic of this animation frame to suit and either don't use Koraths in your game or you make them invincible or else killing them will change them into a stunned robo red) This wiki page list all the different sprite action frames you can choose from.

http://www.shikadi.net/keenwiki/Patch:S ... te_actions

Remember that whatever you choose must be cached in the level somewhere or game will crash uncached sprite error.
Last edited by 55Aavenue on Thu Mar 21, 2019 12:42 am, edited 1 time in total.

User avatar
loop4ever
Posts: 18
Joined: Sun Jan 06, 2019 10:37 pm

Re: My Robo Red stunned patch is causing game crash

Post by loop4ever » Wed Mar 20, 2019 2:03 pm

Once again thanks A LOT! I wasn't satisfied with the whole turn into a new sprite thing, so what I did was compare your code to the original one from the wiki, what I found was that they were almost exactly the same except for the value you mentioned ($1EB2W) and the ($0AAF1517RL), the one on the robo page was ($0B8013E9RL), so all I did was replace my ($0B8013E9RL) with the ($0AAF1517RL) you had in your code, and BOOM, like magic it worked perfectly!

I'm new at all this patch stuff so I would like to know why what I did worked. Also could you test this out and let me know if it works for you? and once again thanks, without Levellass around patching has been harder, good thing is that I'm really trying to learn patching, something I probably wouldn't have done had Levellass been around to make all the patches.

Here's what the stun patch looks like now

Code: Select all

#New collision: Robored stun
%patch $1264D $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $83 $3D $02 $75 $09
              $9A $0AAF1517RL     $5F $5E $5D $CB $83 $3D $03 $75 $18 $C7 $44
              $16 $0000W  $C7 $44 $06 $0001W  $B8 $00F2W  $50 $57 $56 $9A $090B16CDRL
                          $83 $C4 $06 $5F $5E $5D $CB


#New action: Robored stunned 
%patch $30432 $0188W $0188W $0002W $0000W $0000W $0000W $0000W $0000W
              $090B1710RL   $00000000L    $090B195ARL   $0000W
Also this part of the code prevents the stun animation ($0188W $0188W) from showing when the shots smash, there's probably a better way to have done this but hey, I'm new.

Code: Select all

#Red's smashed shots
%patch $32B44 $0000W #Robo Red shot smash 1(Vanish so only seen when stunned)

55Aavenue
Posts: 16
Joined: Wed Apr 04, 2018 7:19 pm

Re: My Robo Red stunned patch is causing game crash

Post by 55Aavenue » Wed Mar 20, 2019 6:58 pm

$0AAF1517RL is the call to run Keen's death code. That must be whats wrong with the orignal patch.

User avatar
loop4ever
Posts: 18
Joined: Sun Jan 06, 2019 10:37 pm

Re: My Robo Red stunned patch is causing game crash

Post by loop4ever » Wed Mar 20, 2019 7:58 pm

Yup that's it. someone needs to update it on the wiki.

User avatar
Nisaba
Posts: 308
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Re: My Robo Red stunned patch is causing game crash

Post by Nisaba » Thu Mar 21, 2019 8:21 am

55Aavenue wrote:
Wed Mar 20, 2019 6:58 pm
$0AAF1517RL is the call to run Keen's death code. That must be whats wrong with the orignal patch.
good work everybody! nice track down.

quick explanation:
$0B8013E9RL is the collision code for Keen 4.
$0AAF1517RL is the collision code for Keen 5.

the wiki should be now up-to-date

Post Reply