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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

No value will be returned by reference

While binding event to delegate broadcast call happening in code, I get the following error: alt text

I think it has to do with the fact I'm returning an array, (saw fixed bugs talking about a NOTE message - not an error) FoundSessions struct:

 // Session result struct
 USTRUCT(BlueprintType)
 struct FRedIronSessionResult
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         FName ServerName;
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         int32 Ping;
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         int32 MaxNumberOfPlayers;
     UPROPERTY(EditAnywhere, BlueprintReadWrite)
         int32 CurrentNumberOfPlayers;
 
     FRedIronSessionResult() {}
 };

The delegate declaration

 DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FFindSessionSuccessDelegateCall, bool, bIsSuccess, TArray<FRedIronSessionResult>, FoundSessions);

The binding inside my class (under public:)

     UPROPERTY(BlueprintAssignable, Category = "Sessions|Delegates")
         FFindSessionSuccessDelegateCall OnFindSessionDone;

The broadcast: (from inside one of the .cpp function)

 TArray<FRedIronSessionResult> SessionResults;
 OnFindSessionDone.Broadcast(false, SessionResults);

What have i done wrong? Thanks

---edit--- Done some more checking - this is happening with every TArray I try to broadcast, not just my struct. Is that a bug or am I using it wrong?

Product Version: UE 4.20
Tags:
error.png (107.3 kB)
more ▼

asked Sep 23 '18 at 11:13 PM in C++ Programming

avatar image

YogevNa
11 3 5

avatar image Steven.W Feb 11 '19 at 12:29 PM

I've been getting this in 4.21.2, it was resolved quite some time ago but has reared its head again. https://issues.unrealengine.com/issue/UE-20613

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

3 answers: sort voted first

I've solved this by using a wrapper to wrap the array, it looks like a bug.

Marking it as solved, yet, no real reason has been given.

more ▼

answered Dec 13 '18 at 11:48 AM

avatar image

YogevNa
11 3 5

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

Are you dragging off the "Event" pin from your "OnFindSessionDone" event and typing "Custom event" to create your custom event with matching signature?

more ▼

answered Sep 24 '18 at 08:55 AM

avatar image

Unfathomable
451 2 5 7

avatar image YogevNa Sep 24 '18 at 11:49 AM

Yes I am dragging from the "Event" pin

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

Declare the delegate like this:

 DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FFindSessionSuccessDelegateCall, bool, bIsSuccess, const TArray<FRedIronSessionResult>&, FoundSessions);
more ▼

answered May 23 '19 at 08:54 PM

avatar image

Ghar
677 33 107 127

(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