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"

Set an Arrayelement of an Array in an Array does not work [structs]

Hey :)

I have two structs: A "Department"-struct and a "Team"-struct. A department can have multiple teams, so the department-struct contains an array of team-structs amongst other things. Also there can be multiply departments, so I have an array of departments. All in all I have an array of structs (Ds) and each of these contains another array of structs (Ts).

At some point in my game I have to recalculate some of the variables of both the departments and their teams. As seen in the attached screenshot, I have two for-each loops looping through the arrays and calling a function, which does my calculations.

At first I tried to work with references I give to the functions (so without the set array elem at the end), but it did not work, as well as my second idea with the set array elem call. It neither works to insert a new element.

The problem is, the variables I changed are not set in the array. They remain the default value I set in the details panel before compiling :(

Until after my functions, everything is fine. The values are correct calculated and the updated structs are returned correctly (I checked with Print String). The only problem is setting them in the arrays.

Am I doing something wrong or are arrays of structs a little buggy in the current release? I found some threads about similar problems, but not exactly the same problem as mine.

Thanks in advance :)

alt text

Product Version: UE 4.8
more ▼

asked Jun 29 '15 at 04:18 PM in Blueprint Scripting

avatar image

6 2 3

avatar image Skyphox3 Jun 30 '15 at 03:03 PM

It seems like these two have had the same problem: Thread 1 Thread 2

I did some further testing and the only problem seems to be the deeper array (Team array). Every action I try to perform on this array fails (adding an element, modifing, removing...). The outer array (department array) seems to work just fine.

I could split things up and remove the 2D-Array-thing but that would result in an ugly index-storing to know which Team belongs to which department. :/

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

0 answers: sort voted first
Be the first one to answer this question
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