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"

Using BlueprintPure causes compile error [Resolved]

I am trying to make a blueprint function that does not have the target input like BlueprintCallable does. Thus I am using BlueprintPure instead, but it can't compile for some reason.

Edit: Just to be clear, BlueprintCallable does compile but "BlueprintCallable, BlueprintPure" cause a compile error and so does just BlueprintPure.

.h

 #pragma once
 
 #include "GameFramework/Actor.h"
 #include "HitTester.generated.h"
 
 UCLASS()
 class HITORIENTATION_API AHitTester : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     AHitTester();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
 
 
     UFUNCTION(BlueprintCallable, BlueprintPure, Category = testCat)
         void CallTest(FVector testinput);
     
 };
 

.cpp

 #include "HitOrientation.h"
 #include "HitTester.h"
 
 
 // Sets default values
 AHitTester::AHitTester()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
 
 }
 
 // Called when the game starts or when spawned
 void AHitTester::BeginPlay()
 {
     Super::BeginPlay();
     
 }
 
 // Called every frame
 void AHitTester::Tick( float DeltaTime )
 {
     Super::Tick( DeltaTime );
 
 }
 
 
 void AHitTester::CallTest(FVector testinput)
 {
     UE_LOG(LogTemp, Warning, TEXT("Called?! %s"), *testinput.ToString());
 }
 

Errors

 Severity    Code    Description    Project    File    Line
 Error    code    OtherCompilationError (5)    HitOrientation    D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error    1
 Error    MSB3073    The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1.    HitOrientation    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets    37
 



The errors it gives if I take out BlueprintCallable:

 Severity    Code    Description    Project    File    Line
 Error (active)        name followed by '::' must be a class or namespace name    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp    28
 Error    MSB3073    The command ""D:\Programs\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat" HitOrientationEditor Win64 Development "D:\Unreal Projects\HitOrientation\HitOrientation.uproject" -rocket -waitmutex -2015" exited with code -1.    HitOrientation    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets    37
 Error    code    OtherCompilationError (5)    HitOrientation    D:\Unreal Projects\HitOrientation\Intermediate\ProjectFiles\Error    1
 Error (active)        name followed by '::' must be a class or namespace name    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp    6
 Error (active)        name followed by '::' must be a class or namespace name    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp    14
 Error (active)        name followed by '::' must be a class or namespace name    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.cpp    21
 Error (active)        this declaration has no storage class or type specifier    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h    6
 Error (active)        expected a ';'    HitOrientation    d:\Unreal Projects\HitOrientation\Source\HitOrientation\HitTester.h    7
 
Product Version: UE 4.10
Tags:
more ▼

asked Nov 16 '15 at 11:24 PM in C++ Programming

avatar image

PappySnail
41 8 9 13

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

2 answers: sort voted first

Remove BlueprintCallable from the blueprint property specifiers for AHitTester::CallTest.

more ▼

answered Nov 17 '15 at 03:15 PM

avatar image

MJ_01
822 38 39 241

avatar image PappySnail Nov 17 '15 at 05:04 PM

It gives me the same errors and then goes on to show even more errors. I updated the question with the errors it shows. I am very confused.

avatar image MJ_01 Nov 17 '15 at 05:32 PM

I could be wrong I believe that BlueprintPure functions are required to be static these days. That's how I write them. give that a test. BlueprintPure functions are meant to be functions that don't necessarily change the owning object. Though, you could pass in values and then change them. Removing the BlueprintCallable means that there are no exec pins. If you need exec pins then re add that.

avatar image PappySnail Nov 17 '15 at 06:26 PM

If I take the variables out of CallTest() and make CallTest() static then it just gives me the original error. I am very confused.

avatar image MJ_01 Nov 17 '15 at 07:41 PM

As Doug Wilson suggested, post the output log. With UE4, the error log is pretty worthless.

avatar image PappySnail Nov 17 '15 at 08:14 PM

Turns out it was a huge mistake on my part. You were right about the class having to be static, and it needs an input or output. Thanks for sticking with me!

Edit: Is there a way for a node to have the exec pins from BlueprintCallable AND have no target input like BlueprintPure? I can't seem to get the exec pins back even if I add BlueprintCallable.

avatar image MJ_01 Nov 17 '15 at 09:26 PM

Removing BlueprintPure and adding BlueprintCallable should do that. Unless static functions are not allowed to be BlueprintCallable on their own. You can go ahead and test that. I would if I was home.

avatar image PappySnail Nov 17 '15 at 10:09 PM

Wow! You are right! Static void gets rid of the target input. Thanks man!

avatar image teak421 Dec 01 '15 at 09:02 PM

Nope... Static is needed on BP Pure....

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

Hey PappySnail-

The "OtherCompilationError (5)" message typically indicates an error that VS . If you go to the Output Tab rather than the Error tab in VS and post the results after attempting to compile it will help point to where exactly the compile error is occurring and how to fix it.

Cheers

Doug Wilson

more ▼

answered Nov 17 '15 at 07:18 PM

avatar image PappySnail Nov 17 '15 at 08:11 PM

I am very embarrassed to have not known this. It told me exactly what the error was and how it fix it. Thank you!

avatar image MJ_01 Nov 17 '15 at 09:21 PM

What was the issue? I am curious to know.

avatar image MJ_01 Nov 17 '15 at 09:27 PM

whoops. I see your comment on the other thread.

(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