Difference between revisions of "Add Extra Characters To Sonic 2"
From Sonic Retro
m (Minor edit) |
(Went on a grammar nazi spree and rewrote a lot of parts since they rendered the guide unusable.) |
||
Line 1: | Line 1: | ||
(Guide By [[User:ManicRemix|Manic Remix]]) | (Guide By [[User:ManicRemix|Manic Remix]]) | ||
+ | (Revised by ThomasSpeedrunner) | ||
− | I was very surprised that this guide didn't exist anywhere else. It seems like nowadays this is the what everybody has in their hacks. This guide will show you how to add extra characters to Sonic The Hedgehog 2 16-bit. We will use the SVN | + | I was very surprised that this guide didn't exist anywhere else. It seems like nowadays this is the what everybody has in their hacks. This guide will show you how to add extra characters to Sonic The Hedgehog 2 (16-bit). We will use the SVN disassembly. In this guide, I will refer to Knuckles, and Amy. |
− | First, open up s2.asm. Search for "Obj_Index". | + | First, open up s2.asm. Search for "Obj_Index:". |
− | You will see: | + | You will see this or something like it: |
<asm> | <asm> | ||
Line 22: | Line 23: | ||
And it will go on. Now, search for "dc.l ObjNull". | And it will go on. Now, search for "dc.l ObjNull". | ||
Replace | Replace | ||
− | <asm> | + | <asm> dc.l ObjNull ; Obj4C |
− | + | dc.l ObjNull ; Obj4D | |
− | + | </asm> | |
− | |||
− | |||
with | with | ||
− | <asm> | + | <asm>ObjPtr_Knuckles: dc.l Obj4C ; Knuckles |
− | + | ObjPtr_Amy: dc.l Obj4D ; Amy | |
− | + | </asm> | |
− | |||
− | |||
− | You've now | + | You've now created an "Knuckles", and "Amy" object. These are the object IDs that will be used for new characters. |
− | Next, search for "InitPlayers". | + | Next, search for "InitPlayers:". |
− | You will see: | + | You will see this or something like it: |
<asm> | <asm> | ||
InitPlayers_TailsAlone: | InitPlayers_TailsAlone: | ||
− | + | move.b #ObjID_Tails,(MainCharacter).w; load Obj02 Tails object at $FFFFB000 | |
− | move.b # | + | move.b #ObjID_SpindashDust,(Tails_Dust).w; load Obj08 Tails' spindash dust/splash object at $FFFFD100 |
− | move.b # | ||
addi.w #4,(MainCharacter+y_pos).w | addi.w #4,(MainCharacter+y_pos).w | ||
rts </asm> | rts </asm> | ||
− | + | Now, below: | |
<asm> | <asm> | ||
− | + | InitPlayers_TailsAlone | |
+ | </asm> | ||
add | add | ||
− | <asm> | + | <asm> subq.w #1,d0 |
− | bne.s InitPlayers_KnuxAlone | + | bne.s InitPlayers_KnuxAlone ; branch if this is a Knuckles alone game |
− | + | </asm> | |
Now, below the "rts", add | Now, below the "rts", add | ||
− | <asm> | + | <asm>InitPlayers_KnuxAlone: |
− | + | subq.w #1,d0 | |
− | + | bne.s InitPlayers_AmyAlone ; branch if this is an Amy alone game | |
− | move.b # | + | move.b #ObjID_Knuckles,(MainCharacter+id).w |
− | move.b # | + | move.b #ObjID_SpindashDust,(Sonic_Dust+id).w |
rts | rts | ||
InitPlayers_AmyAlone: | InitPlayers_AmyAlone: | ||
− | move.b # | + | move.b #ObjID_Amy,(MainCharacter+id).w |
− | + | move.b #ObjID_SpindashDust,(Sonic_Dust+id).w | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | move.b # | ||
rts | rts | ||
+ | </asm> | ||
− | + | Now, go to s2.constants.asm. Find this line: | |
− | + | <asm>ObjID_Buzzer = id(ObjPtr_Buzzer) ; 4B | |
− | + | </asm> | |
− | + | And insert this under it: | |
− | + | <asm>ObjID_Knuckles = id(ObjPtr_Knuckles) ; 4C | |
− | + | ObjID_Amy = id(ObjPtr_Amy) ; 4D | |
+ | </asm> | ||
− | + | Next, go to "OptionScreen_Choices:", and find this line: | |
+ | <asm> dc.l (3-1)<<24|(Player_option&$FFFFFF) | ||
+ | </asm> | ||
+ | Change the 3 to a 5. This will allow for Knuckles and Amy player options. Now go here: | ||
+ | <asm>off_92D2: | ||
+ | dc.l TextOptScr_SonicAndMiles | ||
+ | dc.l TextOptScr_SonicAlone | ||
+ | dc.l TextOptScr_MilesAlone | ||
+ | </asm> | ||
+ | And add this under it: | ||
+ | <asm> dc.l TextOptScr_KnuxAlone | ||
+ | dc.l TextOptScr_AmyAlone | ||
− | Now | + | Now, head here: |
− | <asm> | + | <asm>off_92DE: |
− | + | dc.l TextOptScr_SonicAndTails | |
− | + | dc.l TextOptScr_SonicAlone | |
+ | dc.l TextOptScr_TailsAlone | ||
+ | </asm> | ||
+ | Add the same two lines as before under: | ||
+ | <asm> dc.l TextOptScr_TailsAlone | ||
+ | </asm> | ||
+ | Now find this: | ||
+ | <asm>TextOptScr_TailsAlone: menutxt "TAILS ALONE " ; byte_981C: | ||
+ | </asm> | ||
+ | And add this below it: | ||
+ | <asm>TextOptScr_KnuxAlone: menutxt "KNUCKLES ALONE " | ||
+ | TextOptScr_AmyAlone: menutxt "AMY ALONE " | ||
+ | </asm> | ||
− | Congratulations! You have two new characters. Now you will need to make new sprites | + | Congratulations! You have two new characters. Now you will need to make new sprites, palette, and code for them to work. A good start would be to copy and paste Sonic's code into a new ASM file and change the labels so you don't get "symbol double defined" errors. Have a great day. |
{{S2Howtos}} | {{S2Howtos}} | ||
[[Category:SCHG How-tos|{{PAGENAME}}]] | [[Category:SCHG How-tos|{{PAGENAME}}]] |
Revision as of 11:53, 14 July 2013
(Guide By Manic Remix)
(Revised by ThomasSpeedrunner)
I was very surprised that this guide didn't exist anywhere else. It seems like nowadays this is the what everybody has in their hacks. This guide will show you how to add extra characters to Sonic The Hedgehog 2 (16-bit). We will use the SVN disassembly. In this guide, I will refer to Knuckles, and Amy.
First, open up s2.asm. Search for "Obj_Index:".
You will see this or something like it: <asm>
dc.l Obj01 ; Sonic
dc.l Obj02 ; Tails dc.l Obj03 ; Collision plane/layer switcher dc.l Obj04 ; Surface of the water dc.l Obj05 ; Tails' tails dc.l Obj06 ; Rotating cylinder in MTZ, twisting spiral pathway in EHZ dc.l Obj07 ; Oil in OOZ dc.l Obj08 ; Water splash in Aquatic Ruin Zone, Spindash dust dc.l Obj09 ; Sonic in Special Stage dc.l Obj0A ; Small bubbles from Sonic's face while underwater... </asm>
And it will go on. Now, search for "dc.l ObjNull". Replace <asm> dc.l ObjNull ; Obj4C dc.l ObjNull ; Obj4D </asm>
with
<asm>ObjPtr_Knuckles: dc.l Obj4C ; Knuckles ObjPtr_Amy: dc.l Obj4D ; Amy </asm>
You've now created an "Knuckles", and "Amy" object. These are the object IDs that will be used for new characters.
Next, search for "InitPlayers:". You will see this or something like it: <asm>
InitPlayers_TailsAlone:
move.b #ObjID_Tails,(MainCharacter).w; load Obj02 Tails object at $FFFFB000 move.b #ObjID_SpindashDust,(Tails_Dust).w; load Obj08 Tails' spindash dust/splash object at $FFFFD100 addi.w #4,(MainCharacter+y_pos).w rts </asm>
Now, below: <asm> InitPlayers_TailsAlone </asm>
add <asm> subq.w #1,d0 bne.s InitPlayers_KnuxAlone ; branch if this is a Knuckles alone game </asm>
Now, below the "rts", add <asm>InitPlayers_KnuxAlone: subq.w #1,d0 bne.s InitPlayers_AmyAlone ; branch if this is an Amy alone game move.b #ObjID_Knuckles,(MainCharacter+id).w move.b #ObjID_SpindashDust,(Sonic_Dust+id).w rts
InitPlayers_AmyAlone: move.b #ObjID_Amy,(MainCharacter+id).w move.b #ObjID_SpindashDust,(Sonic_Dust+id).w rts </asm>
Now, go to s2.constants.asm. Find this line: <asm>ObjID_Buzzer = id(ObjPtr_Buzzer) ; 4B </asm> And insert this under it: <asm>ObjID_Knuckles = id(ObjPtr_Knuckles) ; 4C ObjID_Amy = id(ObjPtr_Amy) ; 4D </asm>
Next, go to "OptionScreen_Choices:", and find this line: <asm> dc.l (3-1)<<24|(Player_option&$FFFFFF) </asm> Change the 3 to a 5. This will allow for Knuckles and Amy player options. Now go here: <asm>off_92D2: dc.l TextOptScr_SonicAndMiles dc.l TextOptScr_SonicAlone dc.l TextOptScr_MilesAlone </asm> And add this under it: <asm> dc.l TextOptScr_KnuxAlone dc.l TextOptScr_AmyAlone
Now, head here: <asm>off_92DE: dc.l TextOptScr_SonicAndTails dc.l TextOptScr_SonicAlone dc.l TextOptScr_TailsAlone </asm> Add the same two lines as before under: <asm> dc.l TextOptScr_TailsAlone </asm>
Now find this: <asm>TextOptScr_TailsAlone: menutxt "TAILS ALONE " ; byte_981C: </asm> And add this below it: <asm>TextOptScr_KnuxAlone: menutxt "KNUCKLES ALONE " TextOptScr_AmyAlone: menutxt "AMY ALONE " </asm>
Congratulations! You have two new characters. Now you will need to make new sprites, palette, and code for them to work. A good start would be to copy and paste Sonic's code into a new ASM file and change the labels so you don't get "symbol double defined" errors. Have a great day.