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"

How can I call a function in my aicontroller blueprint from my level blueprint?

I have referenced my aicontroller blueprint as an object variable in my level blueprint and am trying to call a function within it, but the custom event in the aicontroller is not being activated.

Here is my level blueprint setup:
alt text

and the aicontroller:
alt text

Any ideas what I'm doing wrong?

Thanks in advance.

Product Version: Not Selected
Tags:
levelblueprint.png (100.5 kB)
aiontroller.png (46.2 kB)
more ▼

asked Sep 16 '14 at 11:01 PM in Blueprint Scripting

avatar image

ThatJoeThom
82 26 24 29

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

1 answer: sort voted first

How exactly do you set your "Random Player Movement Blueprint" in your Level-Blueprint?

I would assume that this one is empty or at least not referencing the object you want.

Also... not that I want to critique or ask exactly what you're doing but getting inputs in your levelblueprint seems kinda weird.

more ▼

answered Sep 16 '14 at 11:49 PM

avatar image

Erasio
5.9k 291 86 293

avatar image ThatJoeThom Sep 17 '14 at 07:41 AM

Thanks for your response. It is set using an object variable with the variable type set to the aicontroller blueprint that my characters are using.

alt text

I'm aware that setting inputs in the level blueprint is not typical but it works for the current application.

Thanks again.

objectvariable.png (24.9 kB)
avatar image Erasio Sep 17 '14 at 10:08 AM

Well the way you set it up you have a variable of your AI controller but not an instance of it.

Imagine you want to get a bucket full of water. You have a piece of paper where the location of the bucket is written so you can pick it up. However in your case the paper is empty and right now you're holding the paper under the water.

Depending on what you want to use and how many instances of your controller are running around you have a few options.

If it's only one use "Get All Actor from Class" and set the pawn you used. Then get it's owner and set the "Random Player Movement Blueprint" with the result of that (you might have to cast that controller to "Random_Player_Movement" (or whatever exactly you called your AI controller.

avatar image ThatJoeThom Sep 17 '14 at 09:57 PM

Thanks for that, I'm still struggling unfortunately. I have four instances of the character using the AI controller.
How would I go about communicating with all four instances simultaneously?
Thanks again, really appreciate your help.

avatar image Erasio Sep 18 '14 at 02:04 AM

Well have you thought about not talking to them but to let them get the information from somewhere else?

If you don't want that you can use "Get all actors from class" which will output an array of all characters in your current level.

You can go through them with a "For Each" loop which would get you where you wanna be as well ;)

(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