Difference between revisions of "Disable floor collision while dying"
From Sonic Retro
KingofHarts (talk | contribs) m (Added header and footer.) |
KingofHarts (talk | contribs) (Added a bugfix that occurs after the design change.) |
||
Line 2: | Line 2: | ||
This is something that you are most likely to notice in [[Chemical Plant Zone]] while fighting the Act 2 boss. When your character dies, he will still detect any floor that is still above him, and if the detection returns a collision, the character will stop, and just drop like a rock, instead of move upwards like he normally does. This is not necessarily a bug, though it can be "fixed". Perform this fix if you don't want your character to detect floor tiles while dying. | This is something that you are most likely to notice in [[Chemical Plant Zone]] while fighting the Act 2 boss. When your character dies, he will still detect any floor that is still above him, and if the detection returns a collision, the character will stop, and just drop like a rock, instead of move upwards like he normally does. This is not necessarily a bug, though it can be "fixed". Perform this fix if you don't want your character to detect floor tiles while dying. | ||
+ | |||
+ | ==Making the design change== | ||
Find "loc_1E596" (Xenowhirl) or "Floor_ChkTile" (SVN) | Find "loc_1E596" (Xenowhirl) or "Floor_ChkTile" (SVN) | ||
Line 36: | Line 38: | ||
Your character will no longer detect floor tiles above him when dying. | Your character will no longer detect floor tiles above him when dying. | ||
+ | |||
+ | ==Fixing a bug with this change== | ||
+ | Now, everything seems well and good... but now I want you to "19, 65, 09, 17" your way over to Death Egg Zone for a minute. go to the Metal Sonic boss fight. You will notice that your robot adversary falls through the floor. WHY? Well, it's simple. Silver Sonic can't detect the floor with our fix, due to the fact that his initial animation shares the same id as Sonic/Tails while dying. To fix this, add the following lines to the code: | ||
+ | |||
+ | <asm> | ||
+ | ; loc_1E596: | ||
+ | Floor_ChkTile: | ||
+ | move.w d2,d0 | ||
+ | .... | ||
+ | movea.l d1,a1 | ||
+ | ;-------------------------------------- | ||
+ | cmpi.b #$06, $0024(A0) | ||
+ | bne.s Player_Not_Death | ||
+ | cmpi.b #$01, (A0) ; Is Sonic | ||
+ | beq.s Player_Death ; | ||
+ | cmpi.b #$02, (A0) ; Is Miles | ||
+ | bne.s Player_Not_Death ; | ||
+ | Player_Death: ; | ||
+ | move.l #$FFFF0000, A1 | ||
+ | Player_Not_Death: | ||
+ | ;--------------------------------------- | ||
+ | rts | ||
+ | ; =========================================================================== | ||
+ | ; precalculated values for Floor_ChkTile | ||
+ | ; (Sonic 1 calculated it every time instead of using a table) | ||
+ | word_1E5D0: | ||
+ | </asm> | ||
+ | |||
+ | Silver Sonic should behave like he is supposed to again... That's good! Oh, wait... now we gotta fight him. Shit. | ||
{{S2Howtos}} | {{S2Howtos}} | ||
[[Category:SCHG How-tos|Disable floor collision while dying]] | [[Category:SCHG How-tos|Disable floor collision while dying]] |
Revision as of 00:30, 22 June 2012
(Guide written by Esrael)
This is something that you are most likely to notice in Chemical Plant Zone while fighting the Act 2 boss. When your character dies, he will still detect any floor that is still above him, and if the detection returns a collision, the character will stop, and just drop like a rock, instead of move upwards like he normally does. This is not necessarily a bug, though it can be "fixed". Perform this fix if you don't want your character to detect floor tiles while dying.
Making the design change
Find "loc_1E596" (Xenowhirl) or "Floor_ChkTile" (SVN) <asm>
- loc_1E596
Floor_ChkTile:
move.w d2,d0 .... movea.l d1,a1 rts
- ===========================================================================
- precalculated values for Floor_ChkTile
- (Sonic 1 calculated it every time instead of using a table)
word_1E5D0: </asm>
and insert the following code: <asm>
- loc_1E596
Floor_ChkTile:
move.w d2,d0 .... movea.l d1,a1 cmpi.b #$06, $0024(A0) bne.s Player_Not_Death move.l #$FFFF0000, A1
Player_Not_Death:
rts
- ===========================================================================
- precalculated values for Floor_ChkTile
- (Sonic 1 calculated it every time instead of using a table)
word_1E5D0: </asm>
Your character will no longer detect floor tiles above him when dying.
Fixing a bug with this change
Now, everything seems well and good... but now I want you to "19, 65, 09, 17" your way over to Death Egg Zone for a minute. go to the Metal Sonic boss fight. You will notice that your robot adversary falls through the floor. WHY? Well, it's simple. Silver Sonic can't detect the floor with our fix, due to the fact that his initial animation shares the same id as Sonic/Tails while dying. To fix this, add the following lines to the code:
<asm>
- loc_1E596
Floor_ChkTile:
move.w d2,d0 .... movea.l d1,a1
- --------------------------------------
cmpi.b #$06, $0024(A0) bne.s Player_Not_Death cmpi.b #$01, (A0) ; Is Sonic beq.s Player_Death ; cmpi.b #$02, (A0) ; Is Miles bne.s Player_Not_Death ;
Player_Death: ;
move.l #$FFFF0000, A1
Player_Not_Death:
- ---------------------------------------
rts
- ===========================================================================
- precalculated values for Floor_ChkTile
- (Sonic 1 calculated it every time instead of using a table)
word_1E5D0: </asm>
Silver Sonic should behave like he is supposed to again... That's good! Oh, wait... now we gotta fight him. Shit.