StartStopAbility & Use

SOSolacex

Member
Hey there.
Currently I have this for an agent of mine, however it's having some issues.Screenshot_8.png

Currently, the start stop ability on the right both reference speedchange.
When it pursues, it should start running, when it goes back to wander, it should start walking again.

However, unfortunately it never actually changes its speed/ starts running.
Ability = SpeedChange
PriorityIndex= -1
Start = checked
Always return succes = checked.

(The wander speed change has Start = unchecked)

The AI in question DOES have the ability speedchange in his Ultimate Character Locomotion component.


Another issue I am having is the Start Stop Use, which is something I am not super clear on how to use..
But currently it has Slot ID = -1
Action ID = 0
Start = checked
Wait for use complete = checked
Always Return Success = checked.

What it is supposed to do is attack once, and wait (for the cooldown), then attack again if the target is within distance.

However, the Start Stop Use never actually gets marked as success so the AI just keeps attacking very quickly.
How would I fix that?

A related question is how do I seperate different attack animations between abilities?

For example, allow the AI agent to use a different attack based on distance etc.

EDIT: Start & Stop type of speed change are both on manual by the way.
EDIT2: I also gave the AI the item ability: Use
 
Last edited:
Currently, the start stop ability on the right both reference speedchange.
When it pursues, it should start running, when it goes back to wander, it should start walking again.

However, unfortunately it never actually changes its speed/ starts running.
Ability = SpeedChange
PriorityIndex= -1
Start = checked
Always return succes = checked.

(The wander speed change has Start = unchecked)

The AI in question DOES have the ability speedchange in his Ultimate Character Locomotion component.
It's tough to debug without playing with it but my guess is that the Both conditional abort is preventing the ability from starting.

Another issue I am having is the Start Stop Use, which is something I am not super clear on how to use..
But currently it has Slot ID = -1
Action ID = 0
Start = checked
Wait for use complete = checked
Always Return Success = checked.

What it is supposed to do is attack once, and wait (for the cooldown), then attack again if the target is within distance.

However, the Start Stop Use never actually gets marked as success so the AI just keeps attacking very quickly.
How would I fix that?
For this you may need to place a breakpoint within StartStopAbility.OnUpdate and see why the task is returning failure. In most cases it's because the weapon can't be fired successfully.

A related question is how do I seperate different attack animations between abilities?

For example, allow the AI agent to use a different attack based on distance etc.
You'll need to create a new Use Animator Audio State Set selector on ShootableWeapon that performs gets a reference to the Behavior Tree and then accesses the target SharedGameObject. From here you can compute the distance to determine which state index should be returned based upon the distance. This page has more info about the selector API and this page has info on getting the SharedGameObject.
 
For this you may need to place a breakpoint within StartStopAbility.OnUpdate and see why the task is returning failure. In most cases it's because the weapon can't be fired successfully.

It doesn't fail, it just keeps being in progress. Meaning, the task never ends. It doesn't fail nor does it succeed, it just keeps playing.

I'll give the rest a try. Cheers.



EDIT:

I've got the speedchange working. I changed the conditional abort, however it still wouldn't work. When I changed the ability priority of speed change however, it did. Which is weird because I thought the speed change and everything was concurrent, meaning its priority didn't matter?

Haven't been able to get the melee attacks working as of yet.
 
Last edited:
For the melee attacks the best way to see why the task is never returning success is to insert a breakpoint within OnUpdate. There's a lot that determines if an attack is carried out and the definitive way to see what's going on is to set a breakpoint.

Which is weird because I thought the speed change and everything was concurrent, meaning its priority didn't matter?
The Speed Change ability is concurrent, but it can still be blocked from starting by a different ability.
 
Top