Announcement

Collapse
No announcement yet.

Blueprint "Array Get by Reference", and edit struct elements directly

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

    Blueprint "Array Get by Reference", and edit struct elements directly

    I believe that currently when retrieving an item from an array using the Array Get node, it is always a copy of the data inside the array. In some cases, such as when working with structs that contain arrays, it would be better if there was an option to get a reference to the struct inside the array so you can directly alter it. Specifically when the struct contains an array, it would be great if we could directly alter that array without having to make a copy of the struct and reinserting that into the outer array. Here is how it currently would be done:
    Click image for larger version

Name:	array.png
Views:	1
Size:	159.3 KB
ID:	1142317

    And this is what it could look like if there was an Array Get By Reference option:
    Click image for larger version

Name:	array2.png
Views:	1
Size:	94.0 KB
ID:	1142318

    It would be even greater if specific struct members could be altered without having to respecify all others.
    Journeyman's Minimap - Available on Marketplace - Forum topic - Video

    #2
    I actually stumbled upon this 'issue' too! Had to work around my initial project 'structure' that used arrays of structs!
    Could be great though since structs always were a *great* way to organize stuff! (at least for me!)
    Check my User Interface Kit here: https://forums.unrealengine.com/show...-Interface-Kit
    A WIP Hex Planet Generation: https://forums.unrealengine.com/show...ral-Generation

    Comment


      #3
      I assumed it worked the way you are requesting, I hope they make this possible, would make handling item stacking much, much easier.

      Comment


        #4
        There are a few places that struct referencing works fine! But specifically in arrays (and maybe a few other places) you just get copies of the struct which makes it both inefficient and hard to work with!
        Hopes it gets fixed! Thank you!
        Check my User Interface Kit here: https://forums.unrealengine.com/show...-Interface-Kit
        A WIP Hex Planet Generation: https://forums.unrealengine.com/show...ral-Generation

        Comment


          #5
          That would be a great feature. I have a struct to fake 2 dimensional arrays and the blueprint code to manipulate the 'inner' array is quite ugly and can be hard to debug. I would appreciate a simple solution.

          Comment


            #6
            Bump. I need it too. Everyone needs it. hahaha
            It makes a really cumbersome Blueprint when we need to edit struct arrays.
            I tried changing my struct to a class, but instead of extending Actor (I don't need all the Ticking etc), I did it with Object, to keep it lightweight. It just didn't cut it because we can't instantiate new Objects inside Blueprints. That's a bummer. So, for now, I'm making the cumbersome code of editing structs inside arrays.
            Freelancer Game Dev Generalist and Unreal Consultant | Portfolio
            Unreal products: Dynamic Picture Frames, Neo Kinect

            Comment


              #7
              Hey Everyone,

              Thanks for making the array request. I have logged this as UE-18616 to be taken into further consideration by our developers. Let us know if you have any further questions, have a great day!

              - Samantha
              Twitter @UnrealSamantha
              Mobile Development Troubleshooting Guide | Package and Deployment Troubleshooting | How do I report a bug?
              Call me to a thread by posting this: [MENTION]Samantha Sutton[/MENTION]

              Comment


                #8
                +1 for this =) Its cumbersome to do in Blueprints
                W3 Studios

                Comment


                  #9
                  Yes please, we need return updated array from "add" and "add unique" nodes.

                  Comment


                    #10
                    Yes please!
                    Dev Blog
                    Twitter: @TheRealSpoonDog
                    150 FREE Blueprint functions for your project

                    Comment


                      #11
                      Are there any updates on this feature?

                      Comment


                        #12
                        This is crazy. How do you expect people to use this stuff? What's the status?

                        Comment


                          #13
                          Why you didn't developed this node in the first release? This is a very simple and common function in every programming languages.

                          Comment


                            #14
                            Originally posted by Samantha Sutton View Post
                            Hey Everyone,

                            Thanks for making the array request. I have logged this as UE-18616 to be taken into further consideration by our developers. Let us know if you have any further questions, have a great day!

                            - Samantha
                            @SamanthaSutton can you please make UE-18616 public?

                            Comment


                              #15
                              Still there's no sign that someone is working on this.

                              https://forums.unrealengine.com/show...rk-with-Arrays

                              Comment

                              Working...
                              X