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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Bug: TArray of UStruct empties on compile when UStruct is left unchanged

Hey team,

I have run into an issue where a custom c++ UStruct will be cleared on a blueprint compile if it only has a single item within it if the item has not been modified. It works fine with 2, or with a changed single UStruct.

Video of bug: https://youtu.be/NhkbWP7176w

This is running in a brand new widget blueprint with no functions. The array/ustruct structure is as follows:

 //Within MyTestClass.h, which is the parent class of the UMG widget
 
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Tool Tips")
         TArray<FToolTipElementStruct> ToolTipValues;

Enum - ELuaParameterType

 UENUM(BlueprintType)
 enum class ELuaParameterType : uint8
 {
     LFPT_Float     UMETA(DisplayName = "Float"),
     LFPT_String     UMETA(DisplayName = "String"),
     LFPT_Int32    UMETA(DisplayName = "Int32"),
     LFPT_Bool UMETA(DisplayName = "Bool"),
 };

FToolTipElementStruct

 USTRUCT()
 struct FToolTipElementStruct
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tool Tips")
     FLuaFunctionStruct Data;
     
     UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Tool Tips")
         FText TitleText;
 
 };

FLuaFunctionStruct

 USTRUCT()
 struct FLuaFunctionStruct
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
     FString functionName;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         FString memberObjectInstance;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         TArray<FLuaFunctionParameter> parameters;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         TArray<FLuaFunctionParameter> returnParameters;
 
 };

FToolTipElementStruct

 USTRUCT()
 struct FLuaFunctionParameter
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
     ELuaParameterType type;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         float floatValue;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         int32 intValue;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         FString stringValue;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Lua Function")
         bool boolValue;
 
 };


Cheers, Mugen

Product Version: UE 4.9
Tags:
more ▼

asked Oct 05 '15 at 04:22 AM in Bug Reports

avatar image

MugenCity
167 12 18 103

avatar image Doug E ♦♦ STAFF Oct 05 '15 at 06:21 PM

Hey MugenCity-

I tried to copy the STRUCTS you posted into a custom class but received compile errors. Let me know if there is any additional code that these structs rely on or if you can provide steps to follow so that my setup matches yours?

Cheers

Doug Wilson

avatar image MugenCity Oct 06 '15 at 08:43 PM

Hey Doug,

that would be because you're missing the custom enum I guess? Also you will need to add USTRUCT() to the top of both FLuaFunctionStruct & FLuaFunctionParameter - I have updated the code above as I missed adding these.

ELuaParameterType:

 UENUM(BlueprintType)
 enum class ELuaParameterType : uint8
 {
     LFPT_Float     UMETA(DisplayName = "Float"),
     LFPT_String     UMETA(DisplayName = "String"),
     LFPT_Int32    UMETA(DisplayName = "Int32"),
     LFPT_Bool UMETA(DisplayName = "Bool"),
 };

Cheers, MugenCity

avatar image Doug E ♦♦ STAFF Oct 06 '15 at 09:19 PM

What class is MyTestClass the child of? I tried adding the structs/enum to a class based on Actor and when I created a BP based on my class the struct did not clear on compile as shown in the video. If I try to create a class related to UMG my choices are UMGMovieSceneObjectManager or UMGSequencePlayer. Let me know if you're using one of these as the parent to MyTestClass or if you're using another class instead.

avatar image MugenCity Oct 06 '15 at 09:36 PM

MyTestClass is a child of UUserWidget.

To actually access that class I create a widget blueprint, call it TestWidgetBlueprint and change its class to MyTestClass.

Then create another widget blueprint, call it TestClassExampleWidget and add a TestWidgetBlueprint to it. You can then select the TestWidgetBlueprint and find the tool tips section in the designer to try add the return parameter.

For reference:

 UCLASS()
 class AUTOMATIONGAME_API UMyTestClass : public UUserWidget
 {
     GENERATED_BODY()
 
 public:
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Tool Tips")
         TArray<FToolTipElementStruct> ToolTipValues;
 };
(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey MugenCity-

I was able to reproduce the array element being removed during a compile. This seems isolated to using the struct/array inside UMG as I did not get the same behavior for an actor class. This bug has been reported (UE-21877) for further investigation.

Cheers

Doug Wilson

more ▼

answered Oct 07 '15 at 02:55 PM

(comments are locked)
10|2000 characters needed characters left
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