Tree getting stuck on "Start Stop Use"

Grannyboy

Active member
I've recently got stuck on an issue. Its very similar to the question asked in this thread, but the thread is old and died off inconclusive:

Since there seemed to be more ppl with similar issues I thought we solve this problem once and for all in this thread.

My case:
I have an zombie AI with the BodyItem attached to it. I want my zombie to throw a melee hit when he gets close to my Player character. And for that I use this behavior tree:
BH_Stuck_Start_Stop_Use1.PNG

When I run the tree and get close to my zombie it gets stuck on the "Start Stop use" leaf:
BH_Stuck_Start_Stop_Use2.PNG

Why wont the tree throw the melee hit?
Is there any better way of achieving Zombie AI melee hits than this?
 
Your Start Stop Use task has Wait for Use Complete enabled before it ends so it is waiting on the Use item to complete. The Use item will complete when the Use Complete event has been sent. One way to debug this is to place a breakpoint within MeleeWeapon.ItemUseComplete and see if it triggers. If it doesn't trigger then the ability will never end.
 
Your Start Stop Use task has Wait for Use Complete enabled before it ends so it is waiting on the Use item to complete. The Use item will complete when the Use Complete event has been sent. One way to debug this is to place a breakpoint within MeleeWeapon.ItemUseComplete and see if it triggers. If it doesn't trigger then the ability will never end.
I see. I removed the "Use item complete" and the tree continues. The issue is now that the AI wont do the melee attack. How do I approach getting an AI to use a equipped weapon?
 
I think this is more of a melee weapon issue than a Behavior designer issue! I will close this thread instead!
 
It sounds like one of your events are off. The best way to debug this is to place a breakpoint within MeleeWeapon.UseItemUpdate and see what is happening. There are a lot of different parameters and this is the way that I've found is the easiest to figure out the root cause.
 
I am sorry for abandoning this thread without any proper solution to the question first asked.
But I did achieve what I need with another approach! So I thought id share that instead and hopefully it helps some one in the future.
(I cant mark this question complete since it got moved I believe. @Justin maybe you can sort that out if you want)

What you can see in my tree is that when the zombie "can see object" returns true, it seeks my player and when its within reach and seek returns true the zombie start the "Start stop ability" which contains my animation index for the zombie attack animation. After the first "Start stop ability" is played I have an "Wait" that is exactly as long as my animation and after that I simply stop the ability and deal dmg to my player.
Behaviour_works_anim.PNG

The ability that starts is simply changing the Ability Index Parameter to 901:
AbilityStartZombieAttack.PNG

This Ability index parameter calls the animation for the zombie attack from any state in the animator!
AbilityChangeZombieAttack.PNG

The result aint to bad:
 
Top