collapse

Author Topic: Custom death state  (Read 1211 times)

0 Members and 1 Guest are viewing this topic.

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12459
  • Country: Brazil br
  • Last Login:Today at 01:17:37 AM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Custom death state
« on: January 10, 2012, 08:10:31 PM »
Since I solved a question from a user, I think more people could have the same problem so here is a tutorial.

The problem:

You have the original death state where no matter what you're hit with! You always go into state 5030 and get thrown back. What I want to do is make it so that if I get hit by an attack that makes me fall, trip, or go UP (e.g a negative y velset) I will go into the original death state, but if I'm hit by an attack that just effects my x vel, I go into my custom state instead of 5030. I can't get it to work.
I've tried a lot of things, but no go. When you die and go into state 5000, your animation is immediately changed to 5030, followed by a changestate to 5030. Followed by the being thrown back. So again...
I want to go into 5030 ONLY if I'm being hit by an attack that makes me fall, trips me, or hits me upwards. I want to go into my custom state if I'm hit by an attack that only affects my x vel.

The solution:

There are some things about how mugen handle the KO (which I've discovered just now,btw):

Quote
- Mugen ignores the hitshaketime if you are koed, so you it puts you in the state 5000 with 5030 anim on the next tick.

- when you are koed, mugen automatically gives you a vel y = -6, overriding your velocity (any velocity be from 0 to 6 will be override). Beyond a 6 in the ground velocity, mugen will always add 2 in your groundvelocity, so a groundvelocity =0,-10 will turn into 0,-12

- the same applies to fall value. Even if the attack doesn't have a fall =1, it will be given automatically. So, you can't track the fall value right.

So, there is a trick here: If the move has a y velocity, your gethitvar(yvel) will be smaller (we are talking about negative values, so for example -10 is smaller than -6) than -6. *
(click to show/hide)

We already have a velocity trigger, but how to avoid to trigger trip or up moves? by triggering the animtype and the airtype (since when you are in the exact moment of the hit when you koed, you are always on the air)

Quote
type: Returns the type of the hit: 0 for none, 1 for high, 2 for low, 3 for trip (ground only).
animtype: Returns the animation type of the hit. (0 for light, 1 for medium, 2 for hard, 3 for back, 4 for up, 5 for diag-up)

Well, enough talk, here is your code:

Quote
[State -3, ChangeState]
type = ChangeState
triggerall = !Alive && Stateno !=XXXXXX ; <-----your custom state number
trigger1 = GetHitVar(airtype)<3 && gethitvar(yvel) <= -6
value =XXXXXXX
ctrl = 0



Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

* IMT Calendar

April 2024
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 [27]
28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal