YesNoOk
avatar

Afterimage/Changeanim and Targetstates (Solved) (Read 426 times)

Started by KBN22, September 11, 2011, 06:17:23 am
Share this topic:
Afterimage/Changeanim and Targetstates (Solved)
#1  September 11, 2011, 06:17:23 am
  • ***
  • Heroin-flavored bananas finance revolutions!!!
Whenever I activate X-Factor with Ryu, he's in a state with an afterimage that changes anims with the root anim if the anim exists.
Some characters, such as PoTS Ryu, have targetstates for their throws which share an anim number with one or more of my Ryu's Anims.
Instead of having an afterimage for that targetstate, it shows the afterimage of my Ryu's matching anim.
IS there anyway to match up the afterimage/changeanim to a Targetstate instead of my own anim, or IS there anyway detect or stop the afterimage/changeanim when my Ryu is in a targetstate?

*sorry if all that sounds a bit confusing  :S
Code:
;--------------------------------------------------------------------------
[Statedef 4002]
type    = S
movetype= I
physics = S
ctrl = 0
sprpriority =-3

[State 4002, ChangeAnim]
type = ChangeAnim
triggerall = SelfAnimExist(Root,Anim)
triggerall = AnimExist(Root,Anim)
trigger1 = 1
value = (root,anim)
elem = (root,animelemno(0))
ignorehitpause =0

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

[State 4002, Trans]
type = Trans
trigger1 =1
trans =  sub

[State 4002, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
facing = 0
pos = 0,0

[State 4002, AngleDraw]
type = AngleDraw
trigger1 = 1
value = 1
scale = 1+(sin(.0025*var(16))),1+(sin(.0025*var(16)))
ignorehitpause =0

[State 4002, VarSet]
type = Varset
trigger1 =var(16)>=50
v = 11
value = 1
ignorehitpause =0

[State 4002, VarSet]
type = Varset
trigger1 =var(16)=0
v = 11
value =0
ignorehitpause =0

[State 4002, VarSet]
type = Varadd
triggerall = var(11)=0
trigger1 =var(16)<50
v = 16
value = 1
ignorehitpause =0

[State 4002, VarSet]
type = Varadd
triggerall = var(11)=1
trigger1 =var(16)>0
v = 16
value = -1
ignorehitpause =0

[State 4002, assert]
type = assertspecial
trigger1 = 1
flag = NoShadow
flag2 = invisible

[State 4002, afterimage]
type = AfterImage
triggerall = SelfAnimExist(Root,Anim)
triggerall = AnimExist(Root,Anim)
trigger1 = 1
time = 2
trans = add
timegap = 1
framegap = 1
length = 2
PalBright = 128,0,0
PalContrast = 255,0,0
PalAdd = 128,0,0
persistent = 1
ignorehitpause = 1

[State 4002, custom]
type=assertspecial
trigger1=!selfanimexist(root,anim)
flag=invisible

[State 4002, turn]
type = Turn
trigger1 = Facing != Root,Facing

[State 4002, Destroy]
type = destroyself
trigger1 = roundstate !=2
trigger2 = root,fvar(4) <= 0 && time >50
trigger3 = winko
trigger4 = !alive
Last Edit: September 11, 2011, 07:30:40 am by KBN22
Re: Afterimage/Changeanim and Targetstates
#2  September 11, 2011, 06:57:38 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
That's difficult to decipher. As far as i can tell, you get put in a throw state, and the afterimage mess up? Is that correct? The best way to prevent that being a problem is to turn it off when the parent is in a custom state. There are methods of detecting whether you're in one or not.

Quick method is 2 variables. One in state -2 and one in -3. -3 is not read while in a custom state. So use -2 to set it, and -3 sets it's own based on the value of -2. If they don't match, the helper stops working.

-2
varset
v = 0
value = stateno

-3
varset
v = 1
value = var(0)

helper state
afterimagestopworking
var(0) != var(1)

Course if that's not what you're after you're going to need a better explanation.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Afterimage/Changeanim and Targetstates
#3  September 11, 2011, 07:17:20 am
  • ***
  • Heroin-flavored bananas finance revolutions!!!
Pictures will probably explain better than I can.
The afterimage is suppose to changeanims with my Ryu when he's in the "X-Factor" state, as seen in the picture below:
Spoiler, click to toggle visibilty

But when he's in a custom state that uses an anim number that's the same as mine, the changeanim uses my anim of the same number, instead of using the Targetstate anim.
In this case it uses anim 811, or my Air Throw anim instead of P2's anim he uses for his throw.
Spoiler, click to toggle visibilty
Re: Afterimage/Changeanim and Targetstates
#4  September 11, 2011, 07:21:11 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
That's about what i would expect. Your helper knows the parent is playing an animation. It doesn't realise that animation is a custom one. selfanimexist detects if you have the animation. You do. Therefore it will use it. You could turn it off and simply use a red afterimage if in a custom state. It may not provide the growing effect or whatever you're after, but it'll look better (and align correctly) than what you're doing now.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Afterimage/Changeanim and Targetstates
#5  September 11, 2011, 07:30:22 am
  • ***
  • Heroin-flavored bananas finance revolutions!!!
I was afraid of that. I guess I'll have to do something similar to what Ahuron did with his D-Rugal, or what Kohaku did with his Nanaya..Thank you again.
Re: Afterimage/Changeanim and Targetstates
#6  September 11, 2011, 07:32:35 am
  • *****
  • Video Game Veteran
    • USA
    • gcnmario.free.fr
I think I had a similar issue with Omega Zero's white aura a couple of times that this exact issue happened. What I just did was just make either the aura invisible, or stop the afterimages, I think..... I forget. I just wanted to bring it up.  ;P

"You must defeat my flaming
dragon punch to stand a chance."