Announcement

Collapse
No announcement yet.

Can't break out structure that's in a TArray

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can't break out structure that's in a TArray

    I'm stuck making a blueprint for a scoreboard. I have a TArray in the parent c++ class which contains a data structure for elements. The blueprint can see the TArray list just fine and I can use a Get to select the desired element in the array. However, there doesn't seem to be any way to break out the individual items in the data structure using the blueprint. The BP knows what type the array element is, but it won't let me do anything with it. This is how the data structure was declared:

    Code:
    USTRUCT()
    struct FPlayerScoreData
    {
    	GENERATED_USTRUCT_BODY()
    
    	UPROPERTY(BlueprintReadOnly, Category = Scoreboard)
    	FString PlayerName;
    
    	UPROPERTY(BlueprintReadOnly, Category = Scoreboard)
    	FString Score;
    
    	UPROPERTY(BlueprintReadOnly, Category = Scoreboard)
    	FString Ping;
    
    	FPlayerScoreData()
    	{
    		PlayerName = TEXT("");
    		Score = TEXT("");
    		Ping = TEXT("");
    	}
    };

    The TArray in the BP parent class looks like this:

    Code:
    	UPROPERTY(BlueprintReadOnly, Category = Scoreboard)
    	TArray<FPlayerScoreData> RedTeamData;
    What's wrong?

    #2
    I imagine that it's that in the latest release of Unreal Engine (which I imagine is what you are using??) TArray actually has some instability issues as noted in the release notes. Afaik it has not been fixed yet.

    Comment


      #3
      Yeah, I'm using 4.7.3. The question has become moot due to the BP becoming suicidal. I have no idea what happened, but the BP decided it wasn't going to load anymore and gleefully crashes the editor.

      Comment


        #4
        *EDIT!*
        my post below solved: see below below

        I have similar problems using "2-Dimensional"-TArrays:

        USTRUCT( BlueprintType )
        struct FChannelData
        {
        GENERATED_USTRUCT_BODY()

        UPROPERTY( EditAnywhere, BlueprintReadWrite, Category = "OpenVibeSignal" )
        TArray<double> Samples;
        };

        (...)
        UPROPERTY( VisibleAnywhere, Category=OpenVibeSignal, BlueprintReadWrite )
        TArray<FChannelData> RecordedChannels;


        When i try to access the RecordedChannels in BP, the Get node returns an integer (even if the variable type shows it contains ChannelData structs).
        Creating a new variable of the struct is possible, but no break is given to access the inner TArray of doubles.

        is this bug caused? using 4.7.6.
        so workaround with an own getters?


        *EDIT!*
        double is not a blueprint type, mans it is neither usable as UPROPERTY, nor as input or output parameter of UFUNCTIONs. the usage of double inside a UFUNCTION is acceptable.
        Last edited by Schlabbermampf; 08-03-2015, 07:55 PM.
        [CENTER][IMG2=JSON]{

        Comment

        Working...
        X