collapse

Author Topic: Custom death state  (Read 1436 times)

0 Members and 2 Guests are viewing this topic.

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • 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

D2TD VS Showcase Thread by D2TD
[Today at 09:12:03 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by LightFlare
[November 21, 2024, 09:44:09 PM]


Terrordrome: Rise of the Boogeymen Extended Version ( jeepers creepers) version by leonardo
[November 19, 2024, 10:22:47 PM]


Hill of the Nameless(1.1 Only) by Vegaz by LightFlare
[November 19, 2024, 10:50:39 AM]


Golden Axe Returns by gokudo99
[November 19, 2024, 03:59:31 AM]


Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]

* IMT Calendar

November 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