YesNoOk
avatar

how to create dizzy stars effect (Read 69705 times)

Started by demongorne, February 25, 2015, 12:36:16 pm
Share this topic:
how to create dizzy stars effect
#1  February 25, 2015, 12:36:16 pm
  • avatar
  • ***
    • demongorne.webs.com/
hey there I would like to  code a dizzy stars effect on my cvs pro chars can you tell me the easier way to do?
Re: how to create dizzy stars effect
#2  February 25, 2015, 06:58:14 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
You're in luck, I actually made a code-based solution to handle the layering, scaling, and rotation for the tiles! It even correctly binds when you push the character.



Unfortunately I'm on break at work right now, but I'll provide the resources when I get back home (if I remember).
Last Edit: February 25, 2015, 07:02:58 pm by Jesuszilla
Re: how to create dizzy stars effect
#3  February 25, 2015, 09:55:31 pm
  • avatar
  • ***
    • demongorne.webs.com/
This should be great man also I'm having some problems to code the power bar more exactly to scale the inner  bar in statesdef 6130 & 6100, I've send you  a P.M.

Last Edit: February 25, 2015, 11:03:45 pm by demongorne
Re: how to create dizzy stars effect
#4  February 27, 2015, 06:29:55 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Re: how to create dizzy stars effect
#5  February 27, 2015, 01:29:11 pm
  • avatar
  • ***
    • demongorne.webs.com/
I added your code but it doesn't work the sprites 5300 is not display at all when the opponent is hitting....
Re: how to create dizzy stars effect
#6  February 27, 2015, 04:24:10 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
That's because they appear on P1 when they get dizzied. I made this so my characters would use their own dizzy sound and effects. Test on your own characters first; it'll take some adjustment to display them on P2 due to how the code is structured.
Re: how to create dizzy stars effect
#7  February 27, 2015, 04:59:52 pm
  • avatar
  • ***
    • demongorne.webs.com/
Can you tell me what parameter I have change to make work it on p2?
I checked out your code but it doesn't work  neither in p1 nor in p2 
Last Edit: February 27, 2015, 10:15:26 pm by demongorne
Re: how to create dizzy stars effect
#8  February 27, 2015, 11:46:45 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
I busted my ass updating this because I also wanted to get it to "scale" according to character width:

Code:
;---------------------------------------------------------------------------
; 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)
;ignorehitpause =
;persistent =

[State 777, VarSet]
type = VarSet
trigger1 = !Time
var(0) = enemyNear(0), Const(size.head.pos.X)
[State 777, VarSet]
type = VarSet
trigger1 = !Time
var(1) = ifElse(var(0) < 0,-1,1)
[State 777, VarSet]
type = VarSet
trigger1 = 1
var(2) = enemyNear(0),facing

[State 30000, PosSet]
type = VarSet
trigger1 = 1
fvar(0) = ifElse((Pos X - enemyNear(0), Pos X) != Var(0), -Var(2)*(Pos X - enemyNear(0), Pos X - Var(2)*Var(0)), 0)
[State 30000, PosSet]
type = PosAdd
trigger1 = FVar(0)
x = FVar(0)
;y = root, Pos Y
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 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
;.4375 = smallest scale
;--------------
[StateDef 778]
ctrl = 0
anim = 778
[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)
x = parent, FVar(0)
[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, 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)
x = parent, FVar(0)
[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, 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)
x = parent, FVar(0)
[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, 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)
x = parent, FVar(0)
[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

In -2:
Code:
;----------------------------------------------------------------------------------
; Dizzy FX
[State -2]
type = Helper
triggerall = NumTarget
trigger1 = !NumHelper(777)
trigger1 = RoundState = 2
trigger1 = target, Anim = 5300
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

Result:




If you don't want it to scale to enemy width for whatever reason, all you have to do is change the size.ground.front and the size.ground.back in the helper call to a constant.
Last Edit: February 28, 2015, 01:31:40 am by Jesuszilla
Re: how to create dizzy stars effect
#9  February 27, 2015, 11:53:08 pm
  • ******
    • www.justnopoint.com/
That's awesome. Throw this bad boy into a code snippet board too JZ!
Re: how to create dizzy stars effect
#10  February 28, 2015, 01:28:12 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Updated the code in the post. It's fully functional now!
Re: how to create dizzy stars effect
#11  February 28, 2015, 11:49:11 am
  • avatar
  • ***
    • demongorne.webs.com/
I tried out this code on my char but won't work please can fixx this code directly on my char? I wanna have that when p2 is hitting continuosly by hp o hk (about 3/4 times in the original game)  fall on the ground get up and then goes in dizzy state ( I found this coding even in cvs2 rei's chars)
Re: how to create dizzy stars effect
#12  February 28, 2015, 12:28:26 pm
  • ******
You're going off-topic in your own topic. :XD:
You can make a new topic asking how to code the dizzy state/s.

And answering to this: http://mugenguild.com/forum/msg.2087772
Yes, you're going off-topic. I bet you wanted to ask how to code all the dizzy state with the stars effect, but instead you only asked about the effect. I can read, you know.
Last Edit: February 28, 2015, 09:02:49 pm by Alex Sinigaglia
Re: how to create dizzy stars effect
#13  March 01, 2015, 10:03:04 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Re: how to create dizzy stars effect
#14  March 01, 2015, 10:09:02 pm
  • ******
It was his fault for not being clear in the first place.
Last Edit: March 01, 2015, 10:13:16 pm by Alex Sinigaglia
Re: how to create dizzy stars effect
#15  March 01, 2015, 10:15:56 pm
  • avatar
  • ***
    • demongorne.webs.com/
No I opened this topic and you offered to help me  to code Dizzy state anyway no matter I'll do this by myself
Re: how to create dizzy stars effect
#16  March 01, 2015, 10:19:14 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
No, you mentioned the dizzy effects, which is what I helped with.
Re: how to create dizzy stars effect
#17  March 01, 2015, 10:25:28 pm
  • avatar
  • ***
    • demongorne.webs.com/
Ok  there was a misunderstanding but I only say that the dizzy code doesn't work on my char
Re: how to create dizzy stars effect
#18  March 01, 2015, 11:38:19 pm
  • ******
...but I only say that the dizzy code doesn't work on my char
hey there I would like to  code a dizzy stars effect on my cvs pro chars can you tell me the easier way to do?
I don't see you saying that. You asked the easiest way to code the "dizzy stars" effect.
I added your code but it doesn't work the sprites 5300 is not display at all when the opponent is hitting....
Here's where you showed your true colours. :P I knew you were actually asking about this + the effect, but this gave it away.


No I opened this topic and you offered to help me  to code Dizzy state anyway no matter I'll do this by myself
He never said that.
You're in luck, I actually made a code-based solution to handle the layering, scaling, and rotation for the tiles! It even correctly binds when you push the character.
His reply was an answer to the question: "can you tell me the easier way to [code the "dizzy stars" effect]?" and the "code based solution to handle the layering, scaling, and rotation for the tiles!" was referred to the stars and birds in the effect.
Last Edit: March 01, 2015, 11:45:39 pm by Alex Sinigaglia
Re: how to create dizzy stars effect
#19  March 01, 2015, 11:45:46 pm
  • ******
    • www.justnopoint.com/
http://mugenguild.com/forum/msg.264664

Dizzy state is explained in the code archive.

I'm going to move this thread to the Code Library since the information is so useful.
Miscommunication aside, Thank you JZ for sharing this.

demongorne, this will still be useful once you get the dizzy state implemented.
If you have questions on the dizzy state code please make a new topic. I hope the info aids you and happy creating!
Re: how to create dizzy stars effect
#20  March 02, 2015, 06:26:34 am
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
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:
Code:
;---------------------------------------------------------------------------
; 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:
Code:
;----------------------------------------------------------------------------------
; 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:
Code:
;---------------------------------------------------------------------------
; 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.