Final version:

Capcom vs. SNK 2 dizzy FX. Tracks the position of the enemy! (uncomment the ifElse for FVar(1) if you want it to track Y position too)

Resources (tiles, animations): http://www.trinitymugen.net/~Creator/Jesuszilla/dizzycode.zip

Effect helpers:

;---------------------------------------------------------------------------

; Dizzy FX

[Statedef 777]

ctrl = 0

anim = 1

[State 0, DisplayToClipboard]

type = DisplayToClipboard

trigger1 = 1

text = "Pos X = %f, fvar(0) = %f\nP2Pos X = %f"

params = Pos X, fvar(0), (enemyNear(0),Pos X)

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, VarSet]

type = VarSet

trigger1 = !Time

var(0) = EnemyNear(0), Const(Size.Head.Pos.X);root, Const(size.head.pos.X)

[State 777, VarSet]

type = VarSet

trigger1 = !Time

var(1) = EnemyNear(0), Const(Size.Head.Pos.Y)

[State 777, VarSet]

type = VarSet

trigger1 = 1

var(2) = EnemyNear(0), facing

[State 777, VarSet]

type = VarSet

trigger1 = 2

var(3) = ceil(Pos X - EnemyNear(0), Pos X)

[State 777, VarSet]

type = VarSet

trigger1 = 2

var(4) = ceil(Pos Y - EnemyNear(0), Pos Y)

[State 30000, Pos X]

type = VarSet

trigger1 = 1

fvar(0) = ifElse(Var(3) != Var(0), -Var(2)*(Var(3) - Var(2)*Var(0)), 0)

[State 30000, Pos Y]

type = VarSet

trigger1 = 1

fvar(1) = 0;ifElse(Var(4) != Var(1), (Var(1) - Var(4)), 0)

[State 30000, PosSet]

type = PosAdd

trigger1 = FVar(0) || FVar(1)

x = FVar(0)

y = FVar(1)

ignorehitpause = 1

[State 777, Helper]

type = Helper

trigger1 = Time = 0

helperType = normal

name = "birdie"

ID = 778

pos = -Const(Size.Ground.Back),0;-18,0

postype = p1

facing = 1

StateNo = 778

keyctrl = 1

ownpal = 1

supermoveTime = 65535

pausemoveTime = 65535

[State 777, Helper]

type = Helper

trigger1 = Time = 0

helperType = normal

name = "birdie2"

ID = 779

pos = Const(Size.Ground.Front),0;25,-1

postype = p1

facing = 1

StateNo = 779

keyctrl = 1

ownpal = 1

supermoveTime = 65535

pausemoveTime = 65535

[State 777, Helper]

type = Helper

trigger1 = Time = 0

helperType = normal

name = "star"

ID = 780

pos = -2,5

postype = p1

facing = 1

StateNo = 780

keyctrl = 1

ownpal = 1

supermoveTime = 65535

pausemoveTime = 65535

[State 777, Helper]

type = Helper

trigger1 = Time = 0

helperType = normal

name = "star2"

ID = 781

pos = 0,-10

postype = p1

facing = 1

StateNo = 781

keyctrl = 1

ownpal = 1

supermoveTime = 65535

pausemoveTime = 65535

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

;.4375 = smallest scale

;--------------

[StateDef 778]

ctrl = 0

anim = 778

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, VarSet]

type = null

trigger1 = fvar(0) := pi/50*time

trigger1 = fvar(1) := .4375+(.1*sin(FVar(0)))

[State 777, PosSet] ; If I can get it to freeze, I can get it to move

type = PosAdd

trigger1 = parent, FVar(0) || parent, FVar(1)

x = parent, FVar(0)

y = parent, FVar(1)

[State 777, VelSet]

type = VelSet

trigger1 = 1

x = Const(Size.Ground.Front)*sin(FVar(0))/16.0;16*(FVar(1)-.4375);2*sin(pi/50*time)

y = -cos(FVar(0)-pi)/2;.5*(FVar(0)-.4375)

[State 0, AngleDraw]

type = AngleDraw

trigger1 = 1

value = 7.2*Time

scale = FVar(1),FVar(1)

[State 0, SprPriority]

type = SprPriority

trigger1 = 1

value = ifElse((FVar(1)<=.40),-1,3)

ignorehitpause = 1

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

;--------------

[StateDef 779]

ctrl = 0

anim = 778

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, VarSet]

type = null

trigger1 = fvar(0) := pi/50*(time+50)

trigger1 = fvar(1) := .4375+(.1*sin(FVar(0)))

[State 777, PosSet] ; If I can get it to freeze, I can get it to move

type = PosAdd

trigger1 = parent, FVar(0) || parent, FVar(1)

x = parent, FVar(0)

y = parent, FVar(1)

[State 777, VelSet]

type = VelSet

trigger1 = 1

x = Const(Size.Ground.Front)*sin(FVar(0))/16.0;Const(Size.Ground.Front)*(FVar(1)-.4375);2*sin(pi/50*time+50)

y = -cos(FVar(0)-pi)/2;.5*(FVar(0)-.4375)

[State 0, AngleDraw]

type = AngleDraw

trigger1 = 1

value = 7.2*(Time+24)

scale = FVar(1),FVar(1)

[State 0, SprPriority]

type = SprPriority

trigger1 = 1

value = ifElse((FVar(1)<=.40),-1,3)

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

;--------------

[StateDef 780]

ctrl = 0

anim = 777

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, VarSet]

type = null

trigger1 = fvar(0) := pi/50*(time+25)

trigger1 = fvar(1) := .4375+(.1*sin(FVar(0)))

[State 777, PosSet] ; If I can get it to freeze, I can get it to move

type = PosAdd

trigger1 = parent, FVar(0) || parent, FVar(1)

x = parent, FVar(0)

y = parent, FVar(1)

[State 777, VelSet]

type = VelSet

trigger1 = 1

x = Const(Size.Ground.Front)*sin(FVar(0))/16.0;16*(FVar(1)-.4375);2*sin(pi/50*time+50)

y = -cos(FVar(0)-pi)/2;.5*(FVar(0)-.4375)

[State 0, AngleDraw]

type = AngleDraw

trigger1 = 1

value = 7.2*(Time+12)

scale = FVar(1),FVar(1)

[State 0, SprPriority]

type = SprPriority

trigger1 = 1

value = ifElse((FVar(1)<=.40),-1,3)

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

;--------------

[StateDef 781]

ctrl = 0

anim = 777

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, VarSet]

type = null

trigger1 = fvar(0) := pi/50*(time+75)

trigger1 = fvar(1) := .4375+(.1*sin(FVar(0)))

[State 777, PosSet] ; If I can get it to freeze, I can get it to move

type = PosAdd

trigger1 = parent, FVar(0) || parent, FVar(1)

x = parent, FVar(0)

y = parent, FVar(1)

[State 777, VelSet]

type = VelSet

trigger1 = 1

x = Const(Size.Ground.Front)*sin(FVar(0))/16.0;16*(FVar(1)-.4375);2*sin(pi/50*time+50)

y = -cos(FVar(0)-pi)/2;.5*(FVar(0)-.4375)

[State 0, AngleDraw]

type = AngleDraw

trigger1 = 1

value = 7.2*(Time+36)

scale = FVar(1),FVar(1)

[State 0, SprPriority]

type = SprPriority

trigger1 = 1

value = ifElse((FVar(1)<=.40),-1,3)

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

;--------------

[StateDef 782]

ctrl = 0

anim = 1

[State 777, Safeguard]

type = NotHitBy

trigger1 = 1

value = SCA

[State 777, NoShadow]

type = AssertSpecial

trigger1 = 1

flag = noshadow

[State 777, PlaySnd]

type = PlaySnd

trigger1 = !Time

trigger1 = Var(10) := root,Var(10)

value = S3050,ifElse(Var(10)<4,0,1) ; Play Capcom sound for Capcom grooves, and the SNK sound for SNK grooves

[State 0, DestroySelf]

type = DestroySelf

trigger1 = !root, NumTarget

trigger2 = root, HitPauseTime > 0

In -2:

;----------------------------------------------------------------------------------

; Dizzy FX

[State -2]

type = Helper

triggerall = NumTarget

trigger1 = !NumHelper(777)

trigger1 = RoundState = 2

trigger1 = target, StateNo = [5300,5350]

helperType = normal

name = "dizzy"

ID = 777

pos = (enemyNear(0),Const(size.head.pos.X)),(enemyNear(0),Const(size.head.pos.Y))

size.xscale = 1

size.yscale = 1

size.ground.front = 16+enemyNear(0), Const(Size.Ground.Front)

size.ground.back = 16+enemyNear(0), Const(Size.Ground.Front) ;This is intentional

postype = p2

facing = 1

stateno = 777

keyctrl = 0

ownpal = 1

supermovetime = 0

pausemovetime = 0

[State -2]

type = Helper

triggerall = NumTarget

trigger1 = !NumHelper(782)

trigger1 = RoundState = 2

trigger1 = target, Anim = 5300

helperType = normal

name = "dizzy sound"

ID = 782

pos = 0,0

postype = p2

facing = 1

stateno = 782

keyctrl = 0

ownpal = 1

supermovetime = 0

pausemovetime = 0

5300 is the dizzy state itself. It can be as simple as:

;---------------------------------------------------------------------------

; Dizzy

[Statedef 5300]

type = S

movetype= H

physics = N

velset = 0,0

ctrl = 0

anim = 5300

[State 5000, 7]

type = SelfState

trigger1 = Time > 96 ; Base time of 2 seconds in speed 3. (120 * 4/5)

value = 0

ctrl = 1

... or you can add mashy code to make it more fair.