YesNoOk
avatar

AI Gets stuck in the air/ground after performing some moves (Read 1357 times)

Started by nekomaster1000, January 29, 2020, 10:15:39 pm
Share this topic:
AI Gets stuck in the air/ground after performing some moves
#1  January 29, 2020, 10:15:39 pm
  • avatar
    • UK
Sometimes my AI will either perform a move or get hit while in the air, and will act like the air is the new "floor" until it either jumps or gets knocked out of the air by an attack, and I have no idea what causes this to happen. Similar happens with the ground occasionally (usually via the airdash attack). Am I missing any particular triggers that'd help prevent this? Should I dump all the AI code? I'll give an example of what three states looks like.

[State -1, AI, Strong Kick]
type = ChangeState
value = 250
triggerall = roundstate = 2
triggerall = AILevel
triggerall = p2statetype != L
triggerall = p2bodydist x = [0,40]
triggerall = random < 30
triggerall = p2statetype != A
trigger1 = ctrl = 1

[State -1, AI, Jump Strong Punch]
type = ChangeState
value = 620
triggerall = roundstate = 2
triggerall = statetype = A
triggerall = p2statetype != L
triggerall = p2bodydist x = [0,40]
triggerall = random < 50
trigger1 = ctrl = 1

[State -1, AI, Airdash X]
type = ChangeState
value = 270
triggerall = roundstate = 2
triggerall = AILevel
triggerall = statetype = A
triggerall = p2statetype != L
triggerall = random < 60
triggerall = p2bodydist x = [40,400]
trigger1 = ctrl = 1
Re: AI Gets stuck in the air/ground after performing some moves
#2  January 29, 2020, 11:02:55 pm
  • ****
    • crepa.neocities.org
add a "triggerall = statetype != A" line on them

edit: oh, wait, some of these are actual air attacks... does this happens only with the AI?
Re: AI Gets stuck in the air/ground after performing some moves
#3  January 30, 2020, 12:40:52 am
  • avatar
    • UK
Only with the AI, to my knowledge? I haven't been able to replicate it myself, at least - I assume it happens because the AI are executing commands so quickly something breaks.
Re: AI Gets stuck in the air/ground after performing some moves
#4  January 30, 2020, 12:53:15 am
  • ****
    • crepa.neocities.org
Usually getting stuck in the air like this happens when you do a ground move in the air, for example, a standing low punch instead of jumping low punch. To prevent this you use "triggerall = statetype != A".

Your 'Strong Kick' right there is an example, is possible for the AI to use this move in the air since you didn't specify if it can or can not use the move while jumping.

But I see some air moves there too, like the air dash. What I thought was happening is you didn't have a 'gravity' code for when the char finishes the move in air, but you said it's happening only with the AI....

Does the moves have physics = S? The air moves I mean, this can also cause the char to be stuck. If so, you need to change them to physics = A or physics = N, and if you use N you need a gravity code as well.

Finally, see if the air moves change to state 0 when they finish the animation, this can also cause the char to be stuck. They need to change to a land state when their pos Y is >= 0. Take a look at KFM's air moves for reference.