YesNoOk
avatar

Collision box problem (Read 14875 times)

Started by Creamy_Goodness, April 07, 2023, 08:21:00 pm
Share this topic:
Collision box problem
#1  April 07, 2023, 08:21:00 pm
  • ***
    • USA
    • creamyg.jdluke.com/

> I'm currently editing a character from another creator, and I've made some adjustments to one of the attacks. However, even though the character's CLSN1 boxes are hitting the opponent's CLSN2 boxes, the hit isn't registering. Here is the coding for the attack...

;EX butt bump active
[Statedef 1021]
type = A
movetype = A
physics = N
anim = 1001

[state 1021, wall bounce limiter]
type = varadd
trigger1 = movehit
v = 7
value = -1
persistent = 0
ignorehitpause = 1

[state 44, fx]
type = explod
trigger1 = time = 0
anim = F61
postype = p1
pos = 0,0
scale = 1.5,1.5

[state 1011, playsnd]
type = playsnd
trigger1 = time = 0
value = 1000,0

[state 1001, afterimage]
type = afterimage
trigger1 = time = 0
;length = 1
time = 5
timegap = 1

[State X, Blink Yellow]
type = PalFX
trigger1 = time%2
time = 1
add = 200,100,0 ;32,16,0
sinadd = 64,32,5,3
ignorehitpause

[state 1021, 3]
type = velset
trigger1 = animelem = 1
;x = 80
x = 40
;y = -12
y = -3
persistent = 0


;[state 1001, statetypeset]
;type = statetypeset
;trigger1 = animtime = 12
;trigger1 = !movecontact
;movetype = I

;[state 1021, brakes]
;type = velmul
;trigger1 = animtime = 12
;trigger1 = !movecontact
;x = 0

[State 1021, 2]
type = HitDef
trigger1 = animelem = 3
attr = A, SA
animtype  = back
damage    = 60,12
guardflag = MA
hitflag = MAF
pausetime = 1,1
guard.pausetime = 12,12
sparkno = 3
priority = 6, hit
;sparkxy = -100,-180
sparkxy = -40, -60
hitsound   = S1,3
guardsound = S120, 0
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
ground.velocity = 2, 0
air.velocity = 2, -2
guard.velocity = -64         
guard.hittime = 30 ;-6
guard.slidetime = 30
airguard.velocity = -24,-4
airguard.hittime = 26
guard.dist = 640

[State 1021, combo hit]
type = HitDef
trigger1 = animelem = 4
attr = A, SA
animtype  = hard
getpower = 0
damage    = 60,12
guardflag = MA
hitflag = MAF
id = 1020
pausetime = 14,14
sparkno = 3
priority = 6, hit
;sparkxy = 100,-185
sparkxy = -40, -60
hitsound   = S1,3
guardsound = S120, 0
ground.type = High
ground.slidetime = 16
ground.hittime  = 16
air.hittime = 16
guard.slidetime = 30
guard.velocity = -64
guard.hittime = 30
airguard.velocity = -24,-8
ground.velocity = -65,-24
air.velocity = -65,ifelse(var(7)>0,-18,-4)
guard.dist = 640
fall = 1
fall.recover = 0
envshake.ampl = 6
envshake.time = 12

[state 1021, targetstate]
type = targetstate
triggerall = numtarget(1020)
trigger1 = movehit
trigger1 = hitpausetime=13
trigger1 = var(7) > 0
ignorehitpause = 1
value = 670



[state 1021, gravity]
type = gravity
trigger1 = pos y < -1

[state x, combo damage score]
type = varadd
triggerall = numtarget(1020)
trigger1 = movehit = 1
v = 18
value = -12
persistent = 0
ignorehitpause = 1

[state 1003, bounce up]
type = veladd
trigger1 = numtarget(1020)
trigger1 = moveguarded
y = -18
persistent = 0

[state 1003, bounce up]
type = veladd
trigger1 = numtarget(1020)
trigger1 = movehit
y = -6
persistent = 0

[state 1003, on hit mul]
type = velmul
trigger1 = numtarget(1020)
trigger1 = movecontact
x = ifelse(movehit,-0.08,-0.16)
persistent = 0

[state 1001, playerpush]
type = playerpush
trigger1 = p2statetype = L
value = 0
persistent = 1

[state 1001, playerpush]
type = playerpush
trigger1 = p2statetype != L
value = 1
persistent = 1

[state 1021, recov anim]
type = changeanim
trigger1 = numtarget(1020)
trigger1 = movecontact
trigger1 = anim = 1001
value = 1002
ignorehitpause = 0
persistent = 0

[State 1021, end]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y > -vel Y
value = 1022

> Any help would be appreciated.
= = = = = = = = = =
Jason "Creamy Goodness" Tenn
http://creamyg.jdluke.com/
Last Edit: May 27, 2023, 03:18:35 am by Creamy_Goodness
Re: Collision box problem
#2  April 15, 2023, 11:27:28 am
  • *****
  • Shame on you!
    • USA
However, even though the character's CLSN1 boxes are hitting the opponent's CLSN2 boxes, the hit isn't registering.

This is almost always the trigger in the hitdef starting after the attack happens. Double check that.
Also use Debug, ctrl+d, to watch if your state is changing types. If it's going to idle somehow, that would give you the same problem.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Collision box problem
#3  May 27, 2023, 03:18:13 am
  • ***
    • USA
    • creamyg.jdluke.com/

> I just fixed the problem, although the answer was somewhat counter-intuitive. It turns out that all I had to do was change the trigger1 of the Gravity state controller from "pos y < -1" to "time > 1". The attack was still missing some of the time, but changing the VelSet Y value from -3 to -4 fixed that issue. I have no idea why that worked, but I'm just glad it did. I'm now marking this topic as "Solved".
= = = = = = = = = =
Jason "Creamy Goodness" Tenn
http://creamyg.jdluke.com/