[Sonic 1 Github] Sonic 3-ish Victory Poses

Discussion in 'Tutorials' started by Alegamer700, Jun 18, 2023.

  1. Alegamer700

    Alegamer700 Newcomer Member

    Joined:
    Jun 14, 2021
    Messages:
    10
    Location:
    Somewhere in South America
    Well, here I am once more. Well, i saw so many questions about this topic in others Threads. So here we are.
    This was writen by me and I'll use it in my hack, which I'm going to show other day. Credit it's not fully obligatory, but if you want to give me credit for the code, thank you so much.

    Also, it should work in Hivebrain. Just search the corrects labels and you're ready
    1) New Flag

    Like the last one (the one for make work giant rings mid-way through a level) its important to use a unused ram address and name it for not confuse it with another one. I'll use $FFFFF622 and I'll name it "f_victorypose". If you already use that address, search another one in https://info.sonicretro.org/SCHG:Sonic_the_Hedgehog_(16-bit)/RAM_Editing. You should put something like this

    Code:
    f_victorypose   = $FFFFF622
    Well, now the engine will know that f_victorypose is $FFFFF622. Also, if you use Hivebrain, remplace all "f_victorypose" with you selected address
    2) Modifing the SignPost

    Well, the victory pose is supposed to only been set once you complete an act. Well, open "_incObj/0D Signpost.asm" and delete this in Sign_SonicRun

    Code:
            btst    #1,(v_player+obStatus).w
            bne.s    loc_EC70
    Oh, and also the last line in the same part before loc_EC70, or the blue blur will go outscreen. Now put this also at the very end of Sign_SonicRun

    Code:
                    move.b  #01, (f_victorypose) ;Set Victory Flag
    This will set the flag you made before. But before make work the animation, go to sonic.asm because here where we go to
    3) Reset the flag when the level restarts

    Yeah. the flag was set, but not cleared anywhere else. So, let's change it
    Now that you already opened the file I mention before, go to Level_ClrObjRam and put this:
    Code:
                    clr.b  (f_victorypose)
    Now the game will clear the victory flag each time we finish an act... which is not Scrap Brain act 2...
    For solve it, in "_incObj/3A Got Through Card.asm", go to Got_SBZ2 and put the same code line from adove
    Scrap Brain act 3 doesn't matter, because there's no signpost, so the flag will never be set in that level at first place. Well, now the most important part
    4) Make Sonic do his victory pose

    Well, go to "_incObj/Sonic Move.asm" because it's here where is the idle script and in the label .notright, after:
    Code:
            bclr    #5,obStatus(a0)
    insert this:
    Code:
                    tst.b  (f_victorypose)
                    beq.s  .continue
    .victory
            move.b    #id_Leap1,obAnim(a0) ; use victory animation
                    bra.s   .common
    .continue
            move.b    #id_Wait,obAnim(a0) ; use standing animation
    .common
    The .notright label should look like this:
    .notright:
    move.b obAngle(a0),d0
    addi.b #$20,d0
    andi.b #$C0,d0 ; is Sonic on a slope?
    bne.w Sonic_ResetScr ; if yes, branch
    tst.w obInertia(a0) ; is Sonic moving?
    bne.w Sonic_ResetScr ; if yes, branch
    bclr #5,obStatus(a0)
    tst.b (f_victorypose)
    beq.s .continue
    .victory
    move.b #id_Leap1,obAnim(a0) ; use victory animation
    bra.s .common
    .continue
    move.b #id_Wait,obAnim(a0) ; use standing animation
    .common
    btst #3,obStatus(a0)
    beq.s Sonic_Balance
    I used the Leap anim in my hack, but you can change it with any other

    Conclusion

    Well, that's it. I hope this can be useful to someone. If did you see some kind of error in the code, just say me and I'll try to solve it. Also, someday I'll show the hack I was doing (only me and nobody else).

    Goodbye and see ya later!
     
    Last edited: Jun 18, 2023
    Dark Shamil Khan and Hame like this.