Victory pose? (S1)

Discussion in 'Discussion and Q&A Archive' started by M.N.K., Jul 26, 2012.

Thread Status:
Not open for further replies.
  1. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    just a bit of help that i need. seeing as i did this before but have now forgotten how i did it, i wanted to know. I am trying to add a victory pose when you reach the end of a level. i know that i would have to edit the signpost routine and the got through act routine (at least thats how i remember doing it the last time) but the thing is i dont know which part out of them to edit. so i was wondering exactly where would i have to add these lines in order for it to work?


    Code:
    move.b #1,($FFFFF7CC).w ; lock controls
    

    Code:
    move.b #$A,($FFFFD01C).w ;new animation
    
     
  2. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    So you know what to add, approximately where to add it, and you already did.


    Let's assume you lost your code because otherwise I don't understand why you're asking.


    The point is, you seem to forget Sonic is already supposed to do something when the signpost stops (he runs to the right), and that's what you want to replace. So that's where those lines should go (although the first one is already there), and if you read the name of the routines of the signpost, the answer should really be obvious.
     
    Last edited by a moderator: Jul 26, 2012
  3. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    The thing is I already tried that countless times and it didn't work at all. I also seem to notice that when i do place it there, it works for a split second while he still moving for a little bit then just stops. that's the main fix i am trying to get done.
     
  4. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    See, that's an entirely different question. The lines themselves are most likely working as expected and the problem is not to do it, but the fact the animation is reset.


    So, the reason for this is that Sonic is "standing", and standing is not a "set" position of the object when it stops moving or at the beginning of the level, but the consequence of the object not moving (sic). What resets your "victory" animation to the "standing" animation is in "sonic_move". Since Sonic's code runs first, the changes you'll make in an other object will be reset by this subroutine.


    You should find something like "move.b #5,$1C(a0)" a little lower. That's the standing animation.


    There are several ways to fix it, like an exception, using a new mode, etc.
     
  5. RetroX

    RetroX Active Member Member

    Joined:
    Jun 15, 2012
    Messages:
    46
    Location:
    United States
    You can set a flag to replace the line when Sonic is supposed to run right at the signpost and go to loc_131AA and before it says (use standing animation),


    add a code saying if the new flag isn't set to use the standing animation, otherwise, use the new animation. Don't forget to clear the flag when the level loads.


    Understanding that you have knowledge of asm, it shouldn't be hard at all to do this.
     
  6. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    a hell of a bump here, but I thought i should unlock this since i am really in need of help here desperately. so I have been trying for a long time now on how to do this, even with what was posted here before, i tried and am getting no where with this. although i did manage to have it set to where he doesn't run to the right and goes straight to the bonuses routine, the only problem is that I don't know where to add the animation line at. all I ask is that where would i have to put this in? (sorry if i may seem a bit demanding here)
     
  7. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    When the game makes the call for the "Sonic has passed" text to appear, you can put your commands there to lock Sonic's position, and change his animation there.  Make Sonic's RAM load into a1 (make sure a1 issn't being used by naything else), then move the right animation to it.
     
  8. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    Here's how I did this in my own hack:


    st.b ($FFFFF7C8).w ; fully lock the controls
    move.b #$xx,($FFFFD01C).w ; set animation

    Both $FFFFF7CC and $FFFFF7C8 are referred as lock Sonic flags in the Hivebrain's disassembly, however, their purposes are different.

    The flag $FFFFF7CC enables or disables joypad input for Sonic. The memory address that reflects what buttons are pressed or held is $FFFFF604 (Joypad). Sonic object has its own address, where it reads button presses from - $FFFFF602 (SonicControl).

    If $FFFFF7CC is clear, Joypad is copied to SonicControl, and Sonic object receives new button presses from Joypad.

    If $FFFFF7CC is set, SonicControl isn't updated, so the player cannot control Sonic anymore. However, programmer now can send his own buttons to SonicControl to simulate joypad control. By writing a right code, you can create any kind of cutscenes, where Sonic is controlled by CPU, not the player.

    Flag $FFFFF7C8 is used to lock different parts of Sonic's object itself.

    If this flag is $00, Sonic functions normally.

    If this flag is $FF, Obj01_Modes routines are not run. Sonic freezes and other objects can control his moving manually. This is used in SBZ transporters for example.

    If this flag is $01, the above applies and the TouchResponse isn't run. Sonic doesn't react to rings or harmful objects anymore.
     
  9. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    okay thanks alot for both of your options, especially to vlad on this as I actually didnt know that both lock controls worked so differently. guess I learned something from this as well I suppose. anywho i will test this out tommorow if possible and again thanks.

    EDIT: just tested both options and they worked perfectly. third times a charm, thanks so much :). since I have no further questions for this, this thread is now locked for good.
     
    Last edited by a moderator: Apr 26, 2013
Thread Status:
Not open for further replies.