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"

virtual Interface function

 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "IDamageable")
 virtual ETeam GetTeam();

Error: .../DamageableInterface.h(21) : BlueprintImplementableEvents in Interfaces must not be declared 'virtual'

It's NOT a BlueprintImplementableEvent... It's a BlueprintNativeEvent, I assume that this is a minor UE4-bug. But sadly according to the internal code even if it would work correctly, it would still throw an error for BlueprintNativeEvents:

alt text

So basically, virtual methods are no longer allowed for blueprint interfaces but they are allowed for C++ ones?

I also found this: https://forums.unrealengine.com/showthread.php?4089-Are-there-plans-to-add-the-ability-to-override-virtual-functions-in-Blueprint where it is said that by default "all interface functions are virtual by default". This however is not true because when I put this in my character-class (header):

 ETeam GetTeam() override;

It will tell me that it can not find a function to override... If I remove the override it will work. I'm a bit confused..

Product Version: UE 4.11
Tags:
error.png (45.8 kB)
more ▼

asked May 21 '16 at 04:52 PM in C++ Programming

avatar image

Napoleonite
600 93 105 156

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

1 answer: sort voted first

That is because that function will be generated by UHT and will contain code calling blueprint event, otherwise calling this function in C++ would not call out event in blueprint, this is scar that BlueprintNativeEvent do. No worries all you need to do is create function with _Implementation surfix, like this:

 virtual ETeam GetTeam_Implementation();

It will be called when event is triggered

more ▼

answered May 21 '16 at 11:37 PM

avatar image

Shadowriver
37.8k 937 172 1123

(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