YesNoOk
avatar

SF3 air recover (Read 5082 times)

Started by PotS, July 29, 2005, 11:27:11 pm
Share this topic:
SF3 air recover
#1  July 29, 2005, 11:27:11 pm
  • ******
    • network.mugenguild.com/pots/
In the sf3 games, if you hit your opponent with an attack that knocks down, but then while he's falling hit him with one that does not knock down, he will recover from his fall.

e.g.: shoryu ken makes him fall -> light punch makes him recover

Thought about adding it for ryu, and here's what i came up with (after trying other much more complicated but less efficient stuff):

Code:
[State -3, autoairrecover]
type=hitfallset
trigger1=stateno=5050
value=!(gethitvar(type)!=3&&gethitvar(yveladd)<=0&&prevstateno!=5080&&pos y<=-20)

gethitvar(type)!=3 ->char wasn't tripped

gethitvar(yveladd)<=0 ->char wasn't hit downwards

prevstateno!=5080 -> char wasn't OTG

pos y<=-20 -> so that the char won't recover too close to the ground

The ! before all of that makes it so that if all these conditions are true, hitfall is set to 0

What it basically does is reset the hitfall attribute once it has served its purpose (after state 5035), so that next time the char gets hit he'll only fall if the attack knocks down.

EDIT: replaced with the new and improved version that i've been using since some time ago and been forgetting to post
Use anything you want from my works.  If you need to contact me use email, not private messages.
Last Edit: March 01, 2006, 07:53:46 am by P.o.t.S.
Re: SF3 air recover
#2  July 30, 2005, 01:01:57 am
  • **
O_O AWSOME I THINK THIS IS WORTH ALOT >> I MEAN ... Exuce me there Ahem, thanks for the code i been trying to figure that out.
Re: SF3 air recover
#3  July 30, 2005, 03:12:09 pm
  • *****
  • can see your halo
    • Germany
    • Skype - panchasell
    • www.mugenguild.com/
First post tip makes your character air recovery always behave like in SF3 when being hit.

To make characters you hit with your character behave like that, without having to include the first post tip in all of them, the best I could come up with so far is three steps:

1) In your HitDefs, use the ID parameter. Give, where possible, all attacks that should produce this special recovery behavior (i.e. all attacks that do not knock down) the same ID. This is no problem if you don't use HitDef IDs for anything else. If you are already using HitDef IDs and need most of them to be different from each other, this method can still be used, but it will grow in code-size regarding step 3).

2) In your character, include state 5020 from the common1.cns, but modified like so:
Quote
; Custom HITA_SHAKE
[Statedef 5021]; change the statedef number to 5021
type = A
movetype = H
velset = 0, 0

[State 5021, this is it]; this is the important modification. everything else here is just copied from 5020 and optimized a bit - except the other bolded part, the SelfState further down
type = HitFallSet
trigger1 = !time
value = ifelse(alive, 0, -1)


[State 5020, 1]; Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = !Time && (GetHitVar(animtype) != [3, 5])
value = ifelse((GetHitVar(airtype) = 1), 5000, 5010) + GetHitVar(animtype)

[State 5020, 2]; Anim for HIT_BACK
type = ChangeAnim
trigger1 = !Time && (GetHitVar(animtype) = [3, 5])
value = 5030

[State 5020, 3]; Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = !Time && (GetHitVar(animtype) = [4, 5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype); 5051 - 4 + type

[State 5020, 4]; Freeze anim
type = ChangeAnim
trigger1 = Time
value = anim

[State 5020, 5]; in common1.cns this is a ChangeState - but we want to put the opponent back in his own states where he belongs
type = SelfState
trigger1 = HitShakeOver
value = 5030


[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000 || anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001 || anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110, -1, -.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012 || anim = 5002 || anim = 5030 || (anim = [5051, 5059])
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

3) Now after step 1) all attacks that should bring about SF3 air recovery behavior have a certain HitDef ID. In my example, this ID is 200. Under StateDef -3 add:

Code:
[State -3, opponent falling behavior]
type = TargetState
triggerall = numtarget(200)
trigger1 = target(200), alive && target(200), hitfall
value = 5021
ignorehitpause = 1

It works like this: If you have hit an opponent with an attack that does not knock down (attack with ID 200) & this opponent is still alive & he has the hitfall flag set, put this opponent into our modified state 5021. There, his hitfall flag will be correctly set to 0, and he will not fall when he is put back in his own states.

There are two drawbacks I can think of.
        The first is when you need different HitDef IDs for different attacks, for example if you're using them for a custom-made AI. In this case, you will run into a problem with step 3). More or less, you would have to have as many instances of the opponent falling behavior code block as you have unique HitDef IDs and just list all possible HitDef IDs. One with numtarget(200) and target(200), one with numtarget and target(210) and so on. This bloats the code up, but otherwise that's it.

The other potential drawback is that this method does put the player you hit out of his own states for a bit. I have been using this method for some months now in Mike Bison, Chunli and Guile and have not encountered oddities. The risk remains, however, that the character you hit and put into your 5021 state behaves strangely because of he has himself special bevaviors defined for state 5020 that you would force him to skip by putting him in your state 5020-equivalent.
"Several times now, Achamian thought he had glimpsed golden haloes about Kellhus's hands. He found himself envying those, such as Proyas, who claimed to see them all the time."
--R. Scott Bakker
The Thousandfold Thought (2006)
Last Edit: July 30, 2005, 03:15:25 pm by Sepp
Re: SF3 air recover
#4  July 30, 2005, 03:23:27 pm
  • ******
... Some chars have their AI that can recover when they shouldn't be able to (example : Warusaki's boss chars, shôryuuken them and they'll recover extremely fast), can adding this prevent them from doing so ? i.e can it work the other way around, preventing them from recovering.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: SF3 air recover
#5  July 30, 2005, 03:45:02 pm
  • **
... Some chars have their AI that can recover when they shouldn't be able to (example : Warusaki's boss chars, shôryuuken them and they'll recover extremely fast), can adding this prevent them from doing so ? i.e can it work the other way around, preventing them from recovering.

I never even thought of that.... >> and i just used the code lol. no wonder its a bit buggy. thanks for the advice. still good to know on other hand, maybe it can be imporved so it wont effect already recovering characters   ;D
Re: SF3 air recover
#6  July 30, 2005, 04:48:34 pm
  • ******
Quote
thanks for the advice.
What, me ? That wasn't an advice, that was a question :inquisitive:
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: SF3 air recover
#7  July 30, 2005, 07:39:03 pm
  • **
Quote
thanks for the advice.
What, me ? That wasn't an advice, that was a question :inquisitive:
you can take it basicly both ways, the question is basic statement with provides advice that wasnt really thought of untill this point of time. thats why i said thanks for the advice, but i just i should stated, thanks for bringing up this certain Issue.
Re: SF3 air recover
#8  July 30, 2005, 10:45:53 pm
  • *****
  • can see your halo
    • Germany
    • Skype - panchasell
    • www.mugenguild.com/
... Some chars have their AI that can recover when they shouldn't be able to (example : Warusaki's boss chars, shôryuuken them and they'll recover extremely fast), can adding this prevent them from doing so ? i.e can it work the other way around, preventing them from recovering.

warusaki3's characters on AI recover automatically with high probability, and yeah I think it's possible they ignore the fall.recovertime parameter of the hits they catch since the trigger used is GetHitVar(fall.recover) instead of CanRecover. This is something we could mention to warusaki if it's really the case, will confirm later.

But on topic and to answer the question:

No, this code does not really damage automatic recovery codes such as warusaki's. Such recovery is commonly decided in state 5050, and if my code kicks in the hit char never reaches 5050 (knocked up, falling) at all and goes to 5040 (recovering in air, not falling) instead. Difference is, the character recovers in 5040 instead of 5200 or 5210 but eh. Recovering is recovering. XD If my code is not triggered, then the automatic recovery can kick in no problem.
"Several times now, Achamian thought he had glimpsed golden haloes about Kellhus's hands. He found himself envying those, such as Proyas, who claimed to see them all the time."
--R. Scott Bakker
The Thousandfold Thought (2006)
Re: SF3 air recover
#9  July 30, 2005, 11:02:11 pm
  • ******
    • network.mugenguild.com/pots/
i meant it as a defensive advantage, not an offensive disadvantage, so that's why it only affects the char itself

about putting the char in a custom state so often... something i wouldn't want

how about
Code:
[Statedef 5021]
type = A
movetype = H
velset = 0, 0

[State 5021, this is it]
type = HitFallSet
trigger1 = !time
value = ifelse(alive, 0, -1)

[State 5021, back to self]
type = SelfState
trigger1 = !time
value = 5020
?

so that the char still goes through his own 5020
Use anything you want from my works.  If you need to contact me use email, not private messages.
Re: SF3 air recover
#10  July 30, 2005, 11:33:17 pm
  • *****
  • can see your halo
    • Germany
    • Skype - panchasell
    • www.mugenguild.com/
Better. :D
"Several times now, Achamian thought he had glimpsed golden haloes about Kellhus's hands. He found himself envying those, such as Proyas, who claimed to see them all the time."
--R. Scott Bakker
The Thousandfold Thought (2006)
Re: SF3 air recover
#11  March 01, 2006, 07:54:20 am
  • ******
    • network.mugenguild.com/pots/
updated the first post with a better code
Use anything you want from my works.  If you need to contact me use email, not private messages.
Re: SF3 air recover
#12  March 01, 2006, 09:39:16 am
  • ******
GetHitVar(Type) doesn't work, constantly returns 0 (even when not hit)
Code:
[State -2, ghvt]
type = Helper
trigger1 = gethitvar(type) = 1
trigger2 = gethitvar(type) = 0
stateno = 7031
[State -2, ghvt]
type = Helper
trigger1 = gethitvar(type) = 2
stateno = 0
[State -2, ghvt]
type = Helper
trigger1 = gethitvar(type) = 3
stateno = 198
[State -2, ghvt]
type = Helper
trigger1 = gethitvar(type) = 4
stateno = 193
[State -2, ghvt]
type = Helper
trigger1 = gethitvar(type) = 5
stateno = 197
=>
1
2
3
And yes, that spark is helper 7031.
And no, I don't know how Mugen makes the char go to state 5070 since there's nothing about gethitvar(type) in state 5000. Probably hardcoded.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: March 01, 2006, 09:48:00 am by Byakko
Re: SF3 air recover
New #13  March 03, 2006, 08:06:46 am
  • ******
    • network.mugenguild.com/pots/
weird, 'cause it seems to make a difference:
http://rapidshare.de/files/14561187/wtfftw.rar.html
:S

edit: nevermind, that's just because a tripped char doesn't go through state 5050
yeah, forgot that gethitvars only last a tick (well, not even that, they seem to be set, read and reset in the same tick)
gonna make some more tests concerning this
Use anything you want from my works.  If you need to contact me use email, not private messages.
Last Edit: March 03, 2006, 08:14:08 am by P.o.t.S.