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"

Expected a '>', and other errors

I'm experiencing some problems with my header file crashing headfirst.

  • DECLARE_DELEGATE_OneParam throws me this error: *Expected a '>'

  • DECLARE_DELEGATE_OneParam gives me a warning: Function definition for 'DECLARE_DELEGATE' not found.

  • If I remove my attempt to create a delegate the UCLASS() throws an error: This declaration has no storage class or type specifier

I'm unaware of where to look if this is a continuation of an earlier fault in the project. I have not edited the related SOAPGOAPCharacter files, nor any of the others that I see being included...

The headerfile in its entirety:

 // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
 #pragma once
 #include "GameFramework/PlayerController.h"
 #include "SOAPGOAPPlayerController.generated.h"
 
 DECLARE_DELEGATE_OneParam(MoveTo, FVector DestLocation);
 /**
 
 **/
 UCLASS()
 class ASOAPGOAPPlayerController : public APlayerController
 {
     GENERATED_BODY()
 
 public:
     ASOAPGOAPPlayerController();
 
 protected:
     /** True if the controlled character should navigate to the mouse cursor. */
     uint32 bMoveToMouseCursor : 1;
 
     // Begin PlayerController interface
     virtual void PlayerTick(float DeltaTime) override;
     virtual void SetupInputComponent() override;
     // End PlayerController interface
 
     /** Resets HMD orientation in VR. */
     void OnResetVR();
 
     /** Navigate player to the current mouse cursor location. */
     void MoveToMouseCursor();
 
     /** Navigate player to the current touch location. */
     void MoveToTouchLocation(const ETouchIndex::Type FingerIndex, const FVector Location);
     
     /** Navigate player to the given world location. */
     void SetNewMoveDestination(const FVector DestLocation);
 
     /** Input handlers for SetDestination action. */
     void OnSetDestinationPressed();
     void OnSetDestinationReleased();
 
     //Commandeering agents
     ACharacter* PlayerDrivenAgent;
     void Select();
 
     MoveTo SetDestination(FVector DestLocation);
 };
 

Product Version: UE 4.14
Tags:
more ▼

asked Jan 13 '17 at 04:57 PM in C++ Programming

avatar image

Drunkenvalley
371 14 21 46

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

2 answers: sort voted first

You don't need to provide the parameter name to DECLARE_DELEGATE_OneParam. Line 6 should just be DECLARE_DELEGATE_OneParam(MoveTo, FVector);

more ▼

answered Jan 13 '17 at 05:02 PM

avatar image

kgamble
924 42 61 209

avatar image Drunkenvalley Jan 14 '17 at 09:38 AM

That did it. Thanks!

avatar image Drunkenvalley Jan 14 '17 at 09:39 AM

Although I still curiously have a Function definition for 'DECLARE_DELEGATE' not found. Though it doesn't seem to have any apparent effect beyond being a nuisance.

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

I'm not sure about your "UCLASS() declaration has no storage class or type specifier" issue, but your

 DECLARE_DELEGATE_OneParam(MoveTo, FVector DestLocation);

should just be

 DECLARE_DELEGATE_OneParam(MoveTo, FVector);

If you want to specifically name the parameter, you can use:

 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(MoveTo, FVector, DestLocation);

I'm not completely certain what's functionally different between these two methods, but I use the last method for event delegates I work with via blueprints.

more ▼

answered Jan 13 '17 at 05:37 PM

avatar image

jonathan.madden
169 8 8 14

(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