Reset animation when you land from a fall?

Discussion in 'Discussion and Q&A Archive' started by Animemaster, Aug 23, 2009.

Thread Status:
Not open for further replies.
  1. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Well as the title is stated, I'm trying to use a falling style fall by using the falling animation at the begining of certain levels.(like sonic 3k) I have coded a routine, which checks if sonic is on the desired level, and then if he is, use the falling animation. Now I moved his location more up in the air so he falls into the level and while falling, use the falling animation. The problem is after he lands he still uses the falling animation, while moving, jumping, rolling ect. I want to reset his animation when he lands so he carries on like normal. I hope I have explained myself well enough to understand my situation here. I believe Puto has done this in sonic 1 remastered, and I have also asked Selbi but he doesn't know either. I would really appreciaed it, if someone could help me with this problem. I can provide a video of it, if you dn't understand. Thank you for reading.
     
  2. Destructiox

    Destructiox Newcomer Member

    Joined:
    Jul 9, 2009
    Messages:
    17
    One somewhat sloppy suggestion would be to have a checkfor an x-position, followed by a check for a y-position, and only when these two conditions are met the falling animation is used. So for example, if sonic's start position is at 0100 00E0 then have a check to see if #$101 is the x position, if it's less than that then use the falling animation, but to avoid further bugs have the y-position check following so that you can only have that animation when falling from that certain x/y position.


    (I may have explained that badly, if you don't understand what i mean, PM me or hit me up on IRC)
     
  3. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    I've been thinking on it again and I think I have an solution: To the place you are changing his animation to fall, put this:



    tst.b ($FFFFFFE5).w ; was flag set?
    bne.s DontChangeToFall ; if yes, don't change the animation to fall


    *code which changes sonic's anim*


    DontChangeToFall:


    ...



    In Sonic_ResetOnFloor put this just at the beginning:



    move.b #1,($FFFFFFE5).w ; set flag



    And finally in Obj3A_NextLevel put this at the beginning as well:



    clr.b ($FFFFFFE5).w ; clear flag



    Hopefully it works, sicne I haven't tested it.
     
  4. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Not quite, he dosn't use the falling animation at all now.(I done something simular before) Even when he is supposed to be when falling, but not landing.


    Edit: Here is the code:



    Code:
    FallfromSky: 
    
    				cmpi.b	#2,($FFFFFE10).w; is this marble zone
    
    				bne.s   Returntosubroutine
    
    				cmpi.b	#0,($FFFFFE11).w; is this act 1
    
    				bne.s   Returntosubroutine
    
    				move.w	#2, ($FFFFFD4E).w  
    
    FallintoLevel:				
    
    				cmpi.w	#2, ($FFFFFD4E).w 
    
    				bne.s   Returntosubroutine
    
    				tst.b	($FFFFFFE5).w; was flag set?
    
    				bne.s	Returntosubroutine; if yes, don't change the animation to fall
    
    				move.b  #$1B,$1C(a0)			   						
    
    				................................&#59;Was branch to sonic_resetonfloor
    
    				bra.s   Returntosubroutine
     
    Last edited by a moderator: Aug 24, 2009
  5. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Sorry for double post, I just tried this on fusion, but it doesn't work. However, for some reason it works on gens +. So Selbi in a way gets the points. But I don't know why it doesn't work on fusion.
     
  6. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Because Fusion sucks. :p There are so many things which are working on one emulator, but not at the other one, just like Sonic 65's Sound Driver.
     
  7. bareirito

    bareirito Well-Known Member Member

    Joined:
    Nov 17, 2008
    Messages:
    87
    Location:
    Argentina
    Fusion doesn't sucks, the only thing is that it's more accurate and more similar to real hardware than Gens. That's why some hacks crash in Fusion. =P
     
Thread Status:
Not open for further replies.