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"

How to Properly Declare WildCard Variables inside UFunction?

Hey guys,

A followup question from this one -> https://answers.unrealengine.com/questions/839886/wildcard-array-in-ufunction-c-macros.html

I've checked the Documentation and class code as well as other sources. Main two class links provided by @ShadowRiver https://github.com/EpicGames/UnrealEngine/blob/f509bb2d6c62806882d9a10476f3654cf1ee0634/Engine/Source/Runtime/Engine/Classes/Kismet/KismetArrayLibrary.h https://github.com/EpicGames/UnrealEngine/blob/08ee319f80ef47dbf0988e14b546b65214838ec4/Engine/Source/Runtime/Engine/Private/KismetArrayLibrary.cpp

Based on reading this, I've attempted to create, inside a UFunction, a proper Reference to a Wildcard Variable (I'm especially interested in them for Array Wildcards in the blueprint side); so far without any progress.

How should I declare it inside the Header (and how to properly reference and transform them inside the Constructor)?

Thanks! Sorry for the follow up question. I just couldn't get it to work.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 24 '18 at 05:39 AM in C++ Programming

avatar image

me4dinosaur
279 15 18 21

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

1 answer: sort voted first

The Solution for anyone that may ponder upon this. This test resulted in a Success::

in .h

 UFUNCTION(BlueprintPure, meta=(DisplayName = "Test", CompactNodeTitle = "Test", ArrayParm = "TargetArray", ArrayTypeDependentParams = "Item", BlueprintThreadSafe), Category="Test")
     static bool Test(const TArray<UProperty*>& TargetArray, int Index, UProperty*& Item);

in .cpp

 bool UTest::Test(const TArray<UProperty*>& TargetArray, int Index, UProperty*& Item)
 {
     if(TargetArray[0])
     {
         return true;
     }
     else
     {
         return false;
     }
 }

Test Image:

alt text

z-wildcard.jpg (22.3 kB)
more ▼

answered Oct 25 '18 at 05:39 AM

avatar image

me4dinosaur
279 15 18 21

(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