Custom state seemingly impossibly triggering during lie-down?

Started by darthbirdy3, February 07, 2026, 03:00:51 PM

Previous topic - Next topic

darthbirdy3

Hello all. I have had nothing but problems writing a very complex and ridiculous universal beam collision/durability system for my Ikemen game, and this is the final hurdle. This beam attack has OTG capability (it hits opponents in liedown) and is aimed downward, but it uses a custom state to control the opponent better when they are hit with it in the air, and bypasses the landing state, so the combo doesn't drop. My issue is that the custom state is also somehow triggering when the target is lying down. The custom state should clearly not trigger when the opponent is in Statetype = L, according to this targetstate controller:
[State 2003, TargetState]
type = TargetState
triggerall = NumTarget
triggerall = var(1) < 24
triggerall = target,statetype != L
trigger1 = target,statetype = A
trigger1 = movehit = 1
value = 2008

There is no fall and no negative y ground.velocity in the hitdef, but when the beam hits the laying target, it still triggers. The opponent then changed to the hit ground from fall state once the hitshake and hittime are over. There are no problems with crouching or standing. If anyone wants to see the code for the full move, I can add it, but I do warn that it's a large, complex mess.

EDIT:
Well, I feel stupid. Apparently, this is all because I didn't set the down.velocity in the hitdef. I guess when it defaults to the air.velocity (Despite positive y vel), for at least one tick, the engine must be reading that as a statetype A fall state. Anyway, sorry for making a post I solved myself in a few hours.
Still using Mugen after this many years.