Announcement

Collapse
No announcement yet.

Some arrays in construction scripts do not clear automatically in 4.23

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

    Some arrays in construction scripts do not clear automatically in 4.23

    Hi,

    I just ported my project to 4.23 and suddenly some construction scripts stopped working. After some troubleshooting I was able to figure out that some specific arrays no longer clear automatically each time construction script runs. They now require to be manually cleared. This is quite confusing since it is not consistent, as some arrays clear while others don't.

    Here's a very simple example:
    Click image for larger version  Name:	HISMFunction.jpg Views:	1 Size:	86.4 KB ID:	1675126
    This is a small function that runs in the construction script, it adds HISM component, adds it to an array and prints the array length.

    In 4.22, every time I touch the blueprint actor, construction script resets all data and re-runs:
    Click image for larger version  Name:	422.jpg Views:	1 Size:	200.0 KB ID:	1675127

    The exact same construction script in 4.23 accumulates those HISMs in the array, without clearing it automatically:

    Click image for larger version  Name:	423.jpg Views:	1 Size:	126.8 KB ID:	1675128
    Is this a bug or some new feature of 4.23 I need to look out for? If it's a feature, which rule defines if the construction script clears specific array or not before it's called again?

    Thanks in advance.
    https://www.artstation.com/artist/rawalanche

    #2
    I've had a somewhat similar issue after converting my project from 4.22 to 4.23.

    Not really sure if its an engine bug, but every time the construction script runs in the editor, it kept retaining references to spline components (added dynamically) created in the past, and more kept getting added every time.

    Click image for larger version  Name:	trashref.jpg Views:	1 Size:	532.0 KB ID:	1675152

    You can check if it's the same issue with your HISM components by printing out the component names from the array in the editor. The ones that should have been deleted had the 'TRASH' keyword in my project.

    In any case, I ended up fixing it by clearing the array at the start of the construction script.
    Last edited by Stormrage256; 10-18-2019, 11:03 AM.
    Tower Defense Starter Kit | Grid Creation Systems | Top Down Stealth Toolkit

    Comment


      #3
      I'm seeing the same issue and had to force the arrays to clear as Stormrage256 describes.

      Comment


        #4
        Originally posted by Stormrage256 View Post
        I've had a somewhat similar issue after converting my project from 4.22 to 4.23.

        Not really sure if its an engine bug, but every time the construction script runs in the editor, it kept retaining references to spline components (added dynamically) created in the past, and more kept getting added every time.

        Click image for larger version Name:	trashref.jpg Views:	1 Size:	532.0 KB ID:	1675152

        You can check if it's the same issue with your HISM components by printing out the component names from the array in the editor. The ones that should have been deleted had the 'TRASH' keyword in my project.

        In any case, I ended up fixing it by clearing the array at the start of the construction script.
        Yes, same here, getting the trash ones. This is quite confusing because now I am left guessing which arrays need to be cleared manually and which don't :| The fix is obviously not a big deal, but if it remains this way we will not be working in a minefield of arrays, not knowing which ones we have to clear and which not.
        Last edited by Rawalanche; 10-19-2019, 04:43 AM.
        https://www.artstation.com/artist/rawalanche

        Comment


          #5
          Rawalanche thejturner I did some further tests on that. So basically the issue seems to be affecting only arrays that hold references to components (both actor & scene components) that were added in the construction script.

          If the array is of a primitive data type like an int array, everything works just like we'd expect it to. No need to clear the array every single time. The same applies to arrays containing references to Objects created using the Construct Object from Class nodes. So we might be dealing with an engine bug here.
          Tower Defense Starter Kit | Grid Creation Systems | Top Down Stealth Toolkit

          Comment


            #6
            Originally posted by Stormrage256 View Post
            Rawalanche thejturner I did some further tests on that. So basically the issue seems to be affecting only arrays that hold references to components (both actor & scene components) that were added in the construction script.

            If the array is of a primitive data type like an int array, everything works just like we'd expect it to. No need to clear the array every single time. The same applies to arrays containing references to Objects created using the Construct Object from Class nodes. So we might be dealing with an engine bug here.
            I already reported it as one. Let's see what happens
            https://www.artstation.com/artist/rawalanche

            Comment

            Working...
            X