x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Blueprint to AI Task communication

I'm looking for a way to have my Player Controller trigger an event in an AI Task. I've tried several things, but I haven't figured how to cast to the AI Task from inside the Player Controller. Any ideas on how to do this? Thanks.

Product Version: UE 4.16
Tags:
more ▼

asked Jan 30 '18 at 03:29 PM in Using UE4

avatar image

S I G
9 1 3 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi, casting to an AI task from the player controller does not feel quite right to be honest. But if you want to do it that way, I would recommend you set up a blackboard value which you could set from the controller. Then you set up the composite node in your behaviour tree (selector or sequence) to abort itself based on a decorator placed on it.

Best Regards!

more ▼

answered Mar 28 '18 at 08:54 AM

avatar image

BreakMaker
232 4 11 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Actually, I came to think of another solution that is closer to what you want.

You could use an event dispatcher. Create the event dispatcher in the player controller. Cast on "Even receive execute AI" to the controller and bind a custom event in the task to the dispatcher event. Connect the red delegate pin into the custom event in the BT task as you wanted!

Let me know if it helps :)

more ▼

answered Mar 28 '18 at 02:27 PM

avatar image

BreakMaker
232 4 11 15

avatar image S I G Apr 05 '18 at 02:11 AM

Since the OP, I've reworked the AI so that tasks no longer need to be triggered from outside the behavior tree. I appreciate your suggestions though. Thank you.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question