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"

Calling BP function When c++ event gets called

Hi all

I have a blueprint called BP_PawnComputer. Also i have a C++ class called ACECommunication. Also BP_PawnComputer has an instance of this ACECommunication class.

What i want is, whenever BestMoveReceived event inside ACECommunication called, calling a function inside BP_PawnComputer. However while ACECommunication is a pure c++ class, BP_PawnComputer is a pure blueprint class.

For that reason i can't see any solution except carrying some of the functionalities of both classes to c++ or BP. I would like to know if there are other ways i can achieve this, or am i stuck with restructring things here and there?

Thanks in advance.

Product Version: UE 4.9
more ▼

asked Sep 11 '15 at 08:59 PM in C++ Programming

avatar image

186 27 25 39

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

2 answers: sort voted first

BP_PawnComputer is not pure blueprint class, all blueprints are basing (are parented from) on classes in C++ and you can get blueprint class in form of highest base class in C++, so if BP_PawnComputer is Pawn, you can get it APawn and access functions and variables in that is in APawn. You can also make base class in C++ for your blueprints with events which you can call from C++ (make a function with BlueprintImplementableEvent), thats why i always recomand to create base classes in C++ and the objects based from it in blueprints or continue using C++.

Accessing blueprint classes in C++ are same as you access other objects in blueprints, with different function and varables

more ▼

answered Sep 12 '15 at 01:27 AM

avatar image

37.8k 937 172 1123

avatar image Corpse0327 Sep 13 '15 at 09:16 AM

Thank you for the information.

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

You can make an event delegate in the ACECommunication class and bind to it from the BP_PawnComputer.

More info here.

more ▼

answered Sep 11 '15 at 09:15 PM

avatar image

723 40 32 123

(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