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"

(Variable) Unexpected in a marco formal

Other errors I got when compiling:

Not instance of ADD_INTERNAL_DYNAMIC matches the argument list

DECLARE_DYNAMIC_MULTICAST_DELEGATE_Threeparams marco redefinition

Note: See previous definition of DECLARE_DYNAMIC_MULTICAST_DELEGATE_Three params

XD.cpp:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "Test2.h"
 #include "XD.h"
 
 // Sets default values
 AXD::AXD()
 {
      // 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;
 
     newMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Static Mesh"));
     newBox = CreateDefaultSubobject<UBoxComponent>(TEXT("Collision Box"));
     newBox->OnComponentBeginOverlap.AddDynamic(this, onCollide);
 }
 
 // Called when the game starts or when spawned
 void AXD::BeginPlay()
 {
     Super::BeginPlay();
     
 }
 
 // Called every frame
 void AXD::Tick(float DeltaTime)
 {
     Super::Tick(DeltaTime);
 
 }
 

XD.h:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "GameFramework/Actor.h"
 #include "XD.generated.h"
 
 #define DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(UPrimitiveComponent a, AActor b, UPrimitiveComponenet c);
 
 UCLASS()
 class TEST2_API AXD : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     AXD();
 
 protected:
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
 public:    
     // Called every frame
     virtual void Tick(float DeltaTime) override;
     UPROPERTY(EditAnywhere)
     UStaticMeshComponent* newMesh;
 
     UPROPERTY(EditAnywhere)
     UBoxComponent* newBox;
 
     UFUNCTION()
     void onCollide(class UPrimitiveComponent* a, class AActor* b, class UPrimitiveComponent* c)
     {
         Destroy();
     }
     
 };
 

 




Product Version: UE 4.15
Tags:
more ▼

asked Apr 02 '17 at 11:16 PM in C++ Programming

avatar image

AquaPlayzX
1 1 2 6

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

1 answer: sort voted first

FIXED!

 #define DECLARE_DYNAMIC_MULTICAST_DELEGATE(a);
 #define DECLARE_DYNAMIC_MULTICAST_DELEGATE(b);
 #define DECLARE_DYNAMIC_MULTICAST_DELEGATE(c);
more ▼

answered Apr 03 '17 at 02:43 AM

avatar image

AquaPlayzX
1 1 2 6

avatar image cridia Apr 03 '17 at 03:35 AM

Not sure whether that fix is going to do anything but remove your errors.

When you create a new delegate, the notation is slightly different; so be sure to put commas between the variable types and names too. Like this:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(UPrimitiveComponent*, a, AActor*, b, UPrimitiveComponenet*, c);

The #define is not necessary as far as I know for this.

(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