YesNoOk
avatar

Throw coding issue (Read 1259 times)

Started by RMaster007, July 12, 2021, 01:37:36 am
Share this topic:
Throw coding issue
#1  July 12, 2021, 01:37:36 am
  • ***
  • What's a title
  • Novice M.U.G.E.N. creator
    • USA
    • sites.google.com/site/rmaster007smugensite/
So I'm working on a new character right now... and I'm having trouble coding the throw.

https://streamable.com/rnk1p4

For some reason the opponent goes to their hit ground state instead of state 820. Here's the code for it:

Quote
;---------------------------------------------------------------------------
;Slam Throw - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = -1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 800, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = s9108104,0

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Slam Throw - Throwing the opponent
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 0

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1, 0

[State 810, PlaySND]
type = PlaySnd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 9
trigger3 = AnimElem = 13
value = s2, 8

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 25, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 2
trigger2 = AnimElem = 10
pos = 25, 64

[State 810, Bind 2]
type = TargetBind
trigger1 = AnimElem = 3
trigger2 = AnimElem = 11
pos = -18, -73

[State 810, Bind 3]
type = TargetBind
trigger1 = AnimElem = 4
trigger2 = AnimElem = 12
pos = -64, -61

[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElem = 5
trigger2 = AnimElem = 13
pos = -53, -2

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem = 6
pos = -25, 64

[State 810, Bind 6]
type = TargetBind
trigger1 = AnimElem = 7
pos = 18, -73

[State 810, Bind 7]
type = TargetBind
trigger1 = AnimElem = 8
pos = 64, -61

[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElem = 9
pos = 53, -2

[State 810, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 5
trigger2 = AnimElem = 9
value = -25
kill = 0

[State 810, Hurt2]
type = TargetLifeAdd
trigger1 = AnimElem = 13
value = -25
kill = 1

[State 810, Throw]
type = TargetState
trigger1 = AnimElem = 13
value = 821

[State 810, EnvShake]
type = EnvShake
trigger1 = AnimElem = 5
trigger2 = AnimElem = 9
trigger3 = AnimElem = 13
time = 5
freq = 3
ampl = 180

[State 810, Overlay]
type = Explod
trigger1 = AnimElem = 1
anim = 811
ID = 811
pos = 0,0
postype = p1  ;p2,front,back,left,right
vel = 0,0
bindtime = -1
removetime = -2
sprpriority = 5
scale = 1,1
ontop = 1
removeongethit = 1

[State 800, Slam Effect 1]
type = Explod
trigger1 = AnimElem = 5
trigger2 = AnimElem = 13
anim = F62
pos = -53,0
postype = p1  ;p2,front,back,left,right
vel = 0,0
bindtime = -1
removetime = -2
sprpriority = -3
scale = 1,1
ontop = 1
removeongethit = 1

[State 800, Slam Effect 2]
type = Explod
trigger1 = AnimElem = 9
anim = F62
pos = 53,0
postype = p1  ;p2,front,back,left,right
vel = 0,0
bindtime = -1
removetime = -2
sprpriority = -3
scale = 1,1
ontop = 1
removeongethit = 1

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Slam
; (a custom gethit state)
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

;---------------------------------------------------------------------------
;Thrown by Slam - thrown into the air
; (a custom gethit state)
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 4.2,0
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = ifelse((Pos Y>=0),0,.4)

[State 821, 4] ;Hit ground
type = SelfState
trigger1 =Vel Y >=0
trigger1 =Pos Y >=-20
value = 5110;00 ;Hit ground

Any idea on how to make it so the opponent does stay in state 820?
Spriting is harder than I thought.
Last Edit: July 12, 2021, 02:38:57 am by RMaster007
Re: Throw coding issue
#2  July 12, 2021, 02:39:28 am
  • ***
  • What's a title
  • Novice M.U.G.E.N. creator
    • USA
    • sites.google.com/site/rmaster007smugensite/
The bug has been fixed. I just had to remove SelfState from 820. Thanks to Felix Mario for pointing it out via Discord.
Spriting is harder than I thought.