YesNoOk
avatar

It just keeps going trough the floor. (Read 28246 times)

Started by Redkid221, August 17, 2023, 12:41:51 am
Share this topic:
It just keeps going trough the floor.
#1  August 17, 2023, 12:41:51 am
    • USA
For some reason it will just keep going trough the floor when he is in the air. any suggestions? here is the code:
;---------------------------------------------------------------------------
;6H
[Statedef 340]
type    = C
movetype= A
physics = S
juggle  = 1
ctrl = 0
velset = 0,0
poweradd= movehit = 500
anim = 340
sprpriority = 5

[State 340, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 340, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = C, NA
damage    = 50
priority  = 5
animtype  = Heavy
hitflag = MAF
guardflag = M
pausetime = 10,11
hitsound = s30,30
sparkno = 0
sparkxy = -40,-168
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 9
ground.velocity = -5,-40
air.velocity = -5,-36
fall = 1

[State 340, Velset]
type = Velset
trigger1 = AnimElem = 11
x =  3
y = -12

[State 340, Gravity]
type = Gravity
trigger1 = Time > 16

[State 340, 3]
type = CtrlSet
trigger1 = Time = 24
value = 55

[State 400, 4]
type = ChangeState
trigger1 = pos y > 0 && vel y > 0
value = 341
ctrl = 0
Re: It just keeps going trough the floor.
#2  August 17, 2023, 01:00:42 am
  • ****
    • crepa.neocities.org
Post what is in state 341.
Or if you don't have it, that's why.
Re: It just keeps going trough the floor.
#3  August 17, 2023, 08:49:47 am
    • USA
it's the landing state after they land on the ground, but it seems to not activate for some reason.
Re: It just keeps going trough the floor.
#4  August 17, 2023, 01:53:06 pm
  • ****
    • crepa.neocities.org
Ah, just noticed, you have type = C and physics = S for the whole state. You need to change it to type = A and physics either = A or = N.
Since you have a gravity sctrl, physics = N should be ok.

Try adding this after the velset:

[State 340, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(11) >= 0
statetype = A
physics = N
Re: It just keeps going trough the floor.
#5  August 17, 2023, 10:27:47 pm
    • USA
so like this? : ;---------------------------------------------------------------------------
;6H
[Statedef 340]
type    = A
movetype= A
physics = N
juggle  = 1
ctrl = 0
velset = 0,0
poweradd= movehit = 500
anim = 340
sprpriority = 5

[State 340, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 340, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = C, NA
damage    = 50
priority  = 5
animtype  = Heavy
hitflag = MAF
guardflag = M
pausetime = 10,11
hitsound = s30,30
sparkno = 0
sparkxy = -40,-168
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 9
ground.velocity = -5,-40
air.velocity = -5,-36
fall = 1

[State 340, Velset]
type = Velset
trigger1 = AnimElem = 11
x =  3
y = -12

[State 340, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(11) >= 0
statetype = A
physics = N

[State 340, Gravity]
type = Gravity
trigger1 = Time > 16

[State 340, 3]
type = CtrlSet
trigger1 = Time = 24
value = 55

[State 340, 4]
type = ChangeState
trigger1 = pos y > 0 && vel y > 0
value = 341
ctrl = 0
Re: It just keeps going trough the floor.
#6  August 18, 2023, 12:37:22 am
  • ****
    • crepa.neocities.org
No. If you change the type to A in the statedef you don't need a statetypeset. Anyway, I don't know how this move works. Is the character on the ground at the beginning and then he jumps in the air? Is this an air attack?
Also would help if you post the code for the landing state (341).
Re: It just keeps going trough the floor.
#7  August 18, 2023, 01:06:25 am
    • USA
no problem. here is state(341):
;------------------
; 6H - Land
[Statedef 341]
type    = C
movetype= A
physics = C
anim = 341
sprpriority = 1
velset = 0,0

[State 341, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 341, 3]
type = ChangeState
trigger1 = !time
value = 11
ctrl = 1
Re: It just keeps going trough the floor.
#8  August 19, 2023, 07:44:22 pm
  • ****
    • crepa.neocities.org
So I took the time to have a better look at your code.
Let's go step by step:

[Statedef 340]
type    = C
movetype= A
physics = S

This means the character is in a crouch state, is attacking, and the physics is as if they are standing. Since you have a velset that launches the character in the air, you should have a statetypeset to change it to physics = N and statetype = A. Place this after the velset:

[State 340, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 11
statetype = A
physics = N

The trigger1 here should be the same as the velset.

Next:

[State 340, Gravity]
type = Gravity
trigger1 = Time > 16

This trigger for the gravity doesn't make much sense. Usually we apply gravity after the first tick of a velset. You have a velset with trigger1 = AnimElem = 11, so you could change gravity to this:

[State 340, Gravity]
type = Gravity
trigger1 = AnimElemTime(11) > 0

Next

[State 340, 3]
type = CtrlSet
trigger1 = Time = 24
value = 55


Again, I have no idea how the move works but this might be interfering with something, just nullify it for now, it is making the character go back to the crouch state since you have it set as type = C. Also, why is it 55? lol

Try and let me know if it works.
Last Edit: August 19, 2023, 08:19:24 pm by DS
Re: It just keeps going trough the floor.
#9  August 20, 2023, 01:09:07 am
  • **
Re: It just keeps going trough the floor.
#10  January 21, 2024, 07:25:52 pm
  • *
  • MI forever
    • Brazil
[State 340, Velset]
type = Velset
trigger1 = AnimElem = 11
x =  3
y = -12

You might check in your air (or fighter factory) to see if this occours before the gravity command (time > 16)