YesNoOk
avatar

Custom win/death animation after using hyper (Read 329 times)

Started by FastFlash, October 29, 2014, 01:51:19 pm
Share this topic:
Custom win/death animation after using hyper
#1  October 29, 2014, 01:51:19 pm
  • **
    • Portugal
    • segasonic5@gmail.com
    • fastflashmugen.wordpress.com
So, my character has a desperation move
If he uses the move and the oponnent is KO'ed he wins
If he uses the move and oponnent as health left he loses
BUT whatever he wins or loses I want the same animation to play after the move, with no winpose or death animation playing for my character
How would one do this?
God damn it, an entire generation pumping gas, waiting tables; slaves with white collars. Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don't need. We're the middle children of history, man. No purpose or place. We have no Great War. No Great Depression. Our Great War's a spiritual war... our Great Depression is our lives. We've all been raised on television to believe that one day we'd all be millionaires, and movie gods, and rock stars. But we won't. And we're slowly learning that fact. And we're very, very pissed off. ~Tyler Durden; Fight Club
Re: Custom win/death animation after using hyper
#2  October 29, 2014, 01:57:28 pm
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
Sounds like you could solve this with a simple varset. Basically, when your hit with your move, set a var to 1. Then, in the win state, just check for your var to see if it's set and change the animation to your desired one if it is set. If it's not set, things will be like normal.

-[Все слова это только слова.]-
Re: Custom win/death animation after using hyper
#3  October 29, 2014, 02:26:54 pm
  • **
    • USA
    • altoiddealer@gmail.com
I'm not a code genius, so take these as ideas and not as guaranteed best solutions.  I'm also not 100% sure what your animation thing entails.

I think it depends how you want it to behave... whether you want the round to end and "KO" to show up as this animation plays, or if you want the game to just pause until the animation finishes before round end.

If you want KO with no delay, then you could have your character's health reduced to 0 via AddLife state controller, and then customize State 5150.  You would want to add a ChangeState in 5150, where the trigger is "Anim = XXXX" with xxxx being the animation your character performs.  From my experience there is no var recognition in State 5150, so you can't use a var as trigger (maybe I'm wrong).  The new state you change to will complete your animation.

If you want it to pause, well I think you would want to put P2 into a custom state so he loses control and doesn't screw up your animation.  You would have a fullscreen invisibile helper "attack" p2 like ones used for preparing Fatalities in MK chars.

Hope this helps!
Re: Custom win/death animation after using hyper
#4  October 29, 2014, 02:32:02 pm
  • **
    • Portugal
    • segasonic5@gmail.com
    • fastflashmugen.wordpress.com
Sounds like you could solve this with a simple varset. Basically, when your hit with your move, set a var to 1. Then, in the win state, just check for your var to see if it's set and change the animation to your desired one if it is set. If it's not set, things will be like normal.

That worked for the winpose, but something weird happens: he gets stuck on the first frame, the rest of the animation doesn't play
Also, will the same thing work for the losing state without affecting the laying down one?
God damn it, an entire generation pumping gas, waiting tables; slaves with white collars. Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don't need. We're the middle children of history, man. No purpose or place. We have no Great War. No Great Depression. Our Great War's a spiritual war... our Great Depression is our lives. We've all been raised on television to believe that one day we'd all be millionaires, and movie gods, and rock stars. But we won't. And we're slowly learning that fact. And we're very, very pissed off. ~Tyler Durden; Fight Club
Re: Custom win/death animation after using hyper
#5  October 29, 2014, 02:45:07 pm
  • **
    • USA
    • altoiddealer@gmail.com
That worked for the winpose, but something weird happens: he gets stuck on the first frame, the rest of the animation doesn't play
Also, will the same thing work for the losing state without affecting the laying down one?

Check what I said above - that should bypass the "Liedown" animation.  Although I think you need to use "PrevStateNo" trigger for the State Controller that bails you out of State 5150.  You would probably need to create a second half to your character's animation, though, because your 1-tick spent in State 5150 will likely interrupt the animation.
Re: Custom win/death animation after using hyper
#6  October 29, 2014, 03:11:23 pm
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
That worked for the winpose, but something weird happens: he gets stuck on the first frame, the rest of the animation doesn't play
Also, will the same thing work for the losing state without affecting the laying down one?
Before jumping to conclusions, I'd like to see the code you added that isn't working quite right.

Edit:
This is for the win pose. For the death animation, what altoiddealer suggested would work.

-[Все слова это только слова.]-
Last Edit: October 29, 2014, 03:15:09 pm by Алексей
Re: Custom win/death animation after using hyper
#7  October 29, 2014, 03:30:12 pm
  • **
    • Portugal
    • segasonic5@gmail.com
    • fastflashmugen.wordpress.com
That worked for the winpose, but something weird happens: he gets stuck on the first frame, the rest of the animation doesn't play
Also, will the same thing work for the losing state without affecting the laying down one?

Check what I said above - that should bypass the "Liedown" animation.  Although I think you need to use "PrevStateNo" trigger for the State Controller that bails you out of State 5150.  You would probably need to create a second half to your character's animation, though, because your 1-tick spent in State 5150 will likely interrupt the animation.

I'll try that for the liedown

That worked for the winpose, but something weird happens: he gets stuck on the first frame, the rest of the animation doesn't play
Also, will the same thing work for the losing state without affecting the laying down one?
Before jumping to conclusions, I'd like to see the code you added that isn't working quite right.

Edit:
This is for the win pose. For the death animation, what altoiddealer suggested would work.

My code:
Attack:
Code:
[Statedef 6050]
type = S
movetype = A
physics = S
anim = 6050
velset = 0,0
ctrl = 0
sprpriority = 2

[State 1500, SuperPause]
type = SuperPause
trigger1 = !time
time = 60
anim = -1
pos = 17,-29
movetime = 60
darken = 1
poweradd = -3000


[State 1100, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 2
value = 6000,0

[State 3000, Energy]
type = Explod
trigger1 = animelem = 2
anim = 6051
sprpriority = 5
postype = p1
pos = 0,-90
supermove = 1
removetime = -2
ownpal = 1

[State 240, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 200,0

[State 240, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 200,1

[State 240, Projectile]
type = projectile
trigger1 = animelem = 6
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = Back
projanim = 6052
projhitanim = 6053
projscale = 3,3
damage = 13,5
fall = 1
sparkno = -1
guard.sparkno = 0
pausetime = 0,12
ground.type = High      ;Low,Trip,None
ground.slidetime = 20
ground.hittime = 20
air.hittime = 20
ground.velocity = -10, -10
air.velocity = -10, -15
ground.cornerpush.veloff = 0
velocity = 0,0
projhits = 40
projremovetime = 52
projpriority = 4
offset = 100,-21
postype = p1

[State 6050]
type = varset
trigger1 = p2life = 0
v = 2
value = 1

[State 240, PlaySnd]
type = LifeAdd
trigger1 = animelem = 10
value = -399

[State 240, ChangeState]
type = Changestate
trigger1 = animtime = 0
value = 180
ctrl = 1

Win pose:
Code:
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181]
type = changeAnim
trigger1 = var(2) = 1
value = 6054
God damn it, an entire generation pumping gas, waiting tables; slaves with white collars. Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don't need. We're the middle children of history, man. No purpose or place. We have no Great War. No Great Depression. Our Great War's a spiritual war... our Great Depression is our lives. We've all been raised on television to believe that one day we'd all be millionaires, and movie gods, and rock stars. But we won't. And we're slowly learning that fact. And we're very, very pissed off. ~Tyler Durden; Fight Club
Re: Custom win/death animation after using hyper
#8  October 29, 2014, 05:12:56 pm
  • ****
  • Hey.
    • Ukraine
    • mugencoder.com

  • Online
Quote
[State 181]
type = changeAnim
trigger1 = var(2) = 1
value = 6054
I can already see your problem here. You're triggering it each tick that var(2)=1, so basically indefinitely as long as it's set. Either change your trigger so that it happens only one, like at time=0 or add persistent=0 as a parameter, which forces it to only trigger once.



-[Все слова это только слова.]-
Re: Custom win/death animation after using hyper
#9  October 29, 2014, 10:22:40 pm
  • **
    • Portugal
    • segasonic5@gmail.com
    • fastflashmugen.wordpress.com
Quote
[State 181]
type = changeAnim
trigger1 = var(2) = 1
value = 6054
I can already see your problem here. You're triggering it each tick that var(2)=1, so basically indefinitely as long as it's set. Either change your trigger so that it happens only one, like at time=0 or add persistent=0 as a parameter, which forces it to only trigger once.




Thanks that worked, but the round takes to much time to end, it doesn't end right after the animation it takes like 5 seconds. I checked my ctrl parameters and they're all set to 1 in the changestates. Also before the round ends, the animation plays again really fast...
God damn it, an entire generation pumping gas, waiting tables; slaves with white collars. Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don't need. We're the middle children of history, man. No purpose or place. We have no Great War. No Great Depression. Our Great War's a spiritual war... our Great Depression is our lives. We've all been raised on television to believe that one day we'd all be millionaires, and movie gods, and rock stars. But we won't. And we're slowly learning that fact. And we're very, very pissed off. ~Tyler Durden; Fight Club
Re: Custom win/death animation after using hyper
#10  October 29, 2014, 11:14:33 pm
  • ***
  • Ha hA Haaaaaa.....
    • USA
    • electroslair.blogspot.com/
The easiest thing would be to spawn a helper in place of your character with the same animations. Then place/PosSet your character bellow the floor with an invisible anim & use this code to make the round end whenever you want.

[State 50000, endroundfaster]
type = ChangeState
trigger1 = time >= 30
value = 5150
ctrl = 1