News:

MFG's Character of the Month: September 2026 Voting

Main Menu

Problems with a Grab, doesn't end properly!

Started by Rabano, December 16, 2022, 04:17:52 PM

Previous topic - Next topic

Rabano

Im making a char of El Gado, Im posting the proggress in Sprite Projects. my problems is one grab move I want to make.

To the start, Im not good at grabs/throws, and this is the first one Im trying to make without coping and pasting other char's moves.

the idea is that El Gado throws the enemy to the ground and then he break his leg, its pretty simple, but I have a problem and I don't know why this happens.

https://i.imgur.com/Ka6xHKe.mp4

as you can see, the P2 just floats against me and nothing happens.

here's the code of the move.

;Takedown
[Statedef 1300]
type = S
physics = S
moveType = A
ctrl=0
velset=0,0
sprpriority=1
poweradd=72*!var(20)
facep2=1
anim = 1300

[State 1300, Button Detect]
type = VarSet
trigger1 = !Time && !AILevel
var(10) = ifElse((command = "x" || command = "rlsx"), 0, ifElse((command = "y" || command = "rlsy"), 1, 2))

[State 1300, Button Detect (AI)]
type = VarSet
trigger1 = !Time && AILevel
var(10) = ifElse((P2MoveType = H || Random < 500), 2, ifElse(Random < 500, 1, 0))


[State 1300, Vel]
type = velset
trigger1 = animelem = 2 || animelem = 3 || animelem = 4 || animelem = 5 || animelem = 6 || animelem = 7
x = 3

[State 800, Hit]
type=hitdef
trigger1= !time
trigger1 = P2BodyDist x < 55
trigger1= !var(38)
attr=S,NT
hitflag=M-
priority = 1, Miss
getpower=0,0
givepower=0,0
sparkno = -1 +0*(var(33):=0)
guard.sparkno = -1 +0*(var(34):=8000)
sparkxy = -10 + 0*(var(35):=40), var(36):=-50
hitsound = -1 +0*(var(31):=800)
guardsound = -1 +0*(var(32):=0)
fall=0
fall.recover=1
numhits=0
p1stateno=1310

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


;===========<THROW>==========
[Statedef 1310]
type = A
physics = N
moveType = A
anim = 1310
ctrl = 0
velSet = 0,0
sprPriority = 1

[State 810, Lost Target]
type = ChangeState
trigger1 = !Time && !NumTarget
value = 0
ctrl = 1

[State 810, Throw]
type = TargetState
trigger1 = !Time && NumTarget
value = 1315

[State 903, EnvShake]
type = EnvShake
trigger1 = AnimElem = 3
time = 20
ampl = 5

[State 2800, Hit Spark]
type = Helper
trigger1 = animelem = 3
helperType = Normal
stateNo = 8013
ID = 8000
name = "Spark"
posType = P1
pos = ceil(-10* const(size.xscale)), ceil(-22 * const(size.yscale))
ownPal = 1
pauseMoveTime = 65535
superMoveTime = 65535
ignoreHitPause = 1

[State 215, Broken Bone]
type=explod
trigger1= AnimElem = 3
anim=10000
ID=10000
sprpriority=5
postype=p1
pos=10,-100
ownpal=1
scale=1,1
ignorehitpause = 1

[State 1200, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 1300,0
channel = 1

[State 901,1]
type = TargetBind
trigger1 = animelem = 1
pos = 55,0
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 2 || animelem = 3 || animelem = 4
pos = 20,0
time = -1

[State 810, Damage]
type = TargetLifeAdd
trigger1 = NumTarget && AnimElem = 3
value = 140

[State 810, TargetPowerAdd]
type = TargetPowerAdd
trigger1 = NumTarget && AnimElem = 3
value = 36

[State 810, Power]
type = PowerAdd
trigger1 = NumTarget && AnimElem = 3 && !var(20)
value = 72

[State 810, HitAdd]
type = HitAdd
trigger1 = NumTarget && AnimElem = 3
value = 1

[State 810, HitCount]
type = VarAdd
trigger1 = NumTarget && AnimElem = 3
var(13) = 1

[State 210, Width]
type = Width
trigger1 = 1
edge = 60,0

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


;===========<(TARGET)>==========
[Statedef 1315]
type    = A
movetype= H
physics = N
velset = 0,0
sprpriority = -1

[State 700, 2]
type = NotHitBy
trigger1 = 1
value = SCA

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

[state a]
type = velset
trigger1 = animelem = 4
x = -4
y = -6.5

[State 821, 1]
type = VelAdd
trigger1 = animelem = 4,>0
y = .5

[State 821, 3]
type = SelfState
trigger1 = pos y > -vel y
value = 5100

Gêmeos dos Jogos

Hello, how you are? Use this

[State TargetBind]
type = TargetBind
triggerall = NumTarget
trigger1 = AnimElemTime(1) >= 0 && AnimElemTime(2) < 0
pos = 55,0

[State TargetBind]
type = TargetBind
triggerall = NumTarget
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(5) < 0
pos = 20,0

[State TargetState]  ;Use it if you like.
type = TargetState
trigger1 = NumTarget && AnimElem = 5
value = 1375 ; Target State value


Use the Target State (you have to create a state for the opponent to be thrown) to throw the opponent away or in the target's grapple state use the velset to throw the opponent away.

We hope we helped.

Rabano

It did work, thanks you !!

but besides, there's a good tutorial on Grabs? so I kinda know what Im doing?

Gêmeos dos Jogos

We don't know any tutorial, but the tip we give is attention to Anim Elements and target position. We grab our characters manually, without the help of any program. We test it several times until it's good.

Rabano