I was not able to find explanations about SendAIMessage and its proper use cases. Checking the source code just did get me deeper and deeper into stuff like FAIMessage, Braincomponent and so on… so getting somewhat lost here.
I’m confused about parameter and naming: Target is Pawn - so I thought I can use it to send a message to a BT from my pawn. Parameter Message Source does confuse me. It offers anything in the dropdown, even textures.
I would expect to be able to select a BT Task here as destination and in the BT Task, there’s a SetFinishOnMessage node - perfectly matching that.
I did a test, setting BT Task as destination in the source dropdown and reacting on this message in the BTTask - it worked.
So it looks to me like an alternative to stop a running task. Instead using a decorator and setting abort conditions, I just sent a message to the BT Task and it finished. But I’m not sure, if I’m misusing some mechanism here.
Is there anyone who can explain more in depth how this is meant to be used?
BTW: Documentation/flyover help states the following for SetFinishOnMessage:
task execution will be finished (with result ‘Success’) after receiving specified message
The docs are not correct here, the real functionality is better: my test showed, that parameter Success in SendAIMessage can be used to determine, whether the BTTask should finish success or not.