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"

Fail to pass TArray from C++ to Blueprint

I want to pass a TArray from C++ to Blueprint. like this

UFUNCTION(BlueprintImplementableEvent, Category = "chat") void DisplayAddChatLineInfor(TArray dialogNames, TArray dialogColors);

But, When I use it in blueprint, it still told me something error with it. I use 4.4V

Product Version: Not Selected
Tags:
more ▼

asked Sep 10 '14 at 01:47 AM in C++ Programming

avatar image

ryuikuya
319 72 86 109

avatar image TimGS Sep 10 '14 at 06:06 AM

Can you show a code snippet which is using DisplayAddChatLineInfor()?

avatar image ryuikuya Sep 11 '14 at 03:19 AM

E.G:

TArray dialogNames; TArray dialogColors;

DisplayAddChatLineInfor(dialogNames, dialogColors);

Then there is errors like following my screen shot

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

4 answers: sort voted first

I had a similar problem, I solved it by having the function signature as follows

 MyFunction(const TArray<AActor*>& VarName)
more ▼

answered Oct 15 '14 at 11:13 AM

avatar image

balazon
116 6 7 11

avatar image ryuikuya Oct 15 '14 at 01:00 PM

It a really tricky way.^^ thank you very much

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

alt text

more ▼

answered Sep 10 '14 at 02:13 AM

avatar image

ryuikuya
319 72 86 109

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

I am not sure if the usage is correct. TArray is a Template class (as the T indicates). You have to tell this Array which type of Information it should contain.

For example:

 TArray<class AActor> ActorArray;

would contain a variable amount of AActor classes.

For me it looks like you tried to to declare dialogNames and dialogColors as the Type/Class TArray, which makes no sense, because TArray is only a class Template.

more ▼

answered Sep 11 '14 at 06:20 AM

avatar image

RiumEqua
114 8 3 9

avatar image TimGS Sep 11 '14 at 01:16 PM

It's AnswerHub joke, it's eating some special characters.

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

What's the declaration for DisplayAddChatLineInfor()?

Assuming you've passed the correct variable types, it's requesting the function to accept const variables, which means the variables you're passing are either declared as const variables or you're instantiating the variables inline during the function call - which automatically declares the variables as const.

more ▼

answered Sep 11 '14 at 07:41 AM

avatar image

schmit
226 7 10 15

(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