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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Elements in Structure Array not being set in BP

The Array Add blueprint node does not work with vector arrays in Structures (specifically created inside the Editor through the Content Browser). I think my images verify this claim.

My first image illustrates that were attempting to add to a structure array. The 2nd demonstrates that after the Add function finishes, the added random unit vector actually wasn't added to the array - it's empty.

Am I doing something wrong? Or is this a bug?

breakpoint after breakpoint

Product Version: Not Selected
Tags:
more ▼

asked Nov 11 '14 at 06:04 PM in Blueprint Scripting

avatar image

JesseMeyer
13 2 4 6

avatar image TJ V ♦♦ STAFF Nov 11 '14 at 06:49 PM

Hi JesseMeyer,

I just tested this in-house and each time I moved the blueprint the value was stored. Try this setup to see it in real-time.

Add a Get after the value was stored and then run your project in Simulate mode. While simulating, move the blueprint around.

alt text

avatar image JesseMeyer Nov 11 '14 at 07:54 PM

Hi TJ.

Thanks for your helpful response. That does work for me. I trusted the debug output - is there a reason why it doesn't report the array's contents?

I must admit my real world case is more complex than the example I posted, which does not work. With it, I use an array of structure arrays.

I have modified the working blueprint to better mirror the real usage, and have succeeded in causing it to fail. :) Perhaps again I am misunderstanding how Blueprint operate.

alt text

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

2 answers: sort voted first

Hi Jesse,

Here is the solution we came up with. This may need to be altered depending on how you are planning to use it. The trick is you must set the array size before adding/setting the array elements.

I did this on a Event Begin Play in the Event Graph.

alt text

Then set the array elements in the Construction Script.

alt text

more ▼

answered Nov 12 '14 at 09:07 PM

avatar image

TJ V ♦♦ STAFF
41.1k 1009 183 493

avatar image JesseMeyer Nov 13 '14 at 03:01 AM

Thank you! That did resolve the problem.

I speculate the fundamental issue is a lack of recursive parsing of whatever instrument is crawling the node hierarchy logic - forcing otherwise clean solutions to adopt logical cruft to migrate around the problem. Whatever the limitation, are there plans to improve it?

avatar image TJ V ♦♦ STAFF Nov 13 '14 at 02:12 PM

Fundamentally this is just how struct arrays work in the engine. However, we are actively working to improve them and will hopefully streamline this process a bit in the future.

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

Hello,

I think it's still broken in 4.9 but I kind of see why, since we use the the "get" node, we declare our operations as "I'm not gona modify this value, just read it". So it's logical why does it not work.

With this soulution below, you can set any elements of a struct, and use all the regular array operations even width arrays in arrays of struct (that's happening in the image).

Just remember, never try to modify something you get out of a "get" node and you will be fine. (of course only if structs are involved :P) alt text

untitled-2.png (189.1 kB)
more ▼

answered Sep 06 '15 at 08:06 AM

avatar image

Kilvin Games
15 1 2 5

(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