Announcement

Collapse
No announcement yet.

Struct Array, Automatically apply last "array elemenent"s modified values to the next?

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

    Struct Array, Automatically apply last "array elemenent"s modified values to the next?

    Ok so I'm not sure how I'm gonna explain this problem but I'll try. I'm currently working on a modular/procedural spline tool, not too dissimulator from the procedural road spline tutorial by epic on YouTube. The goal of the spline is to be able to change the default spline mesh to one of a group of other meshes from the Details panel at the desired spline point, e.g. spline point 0-3 = Mesh 1(Default mesh), spline point 4-5 = mesh 2. The way I want it to work is that if I set spline point 3 to spline mesh 2, spline point 4,5,6 etc (when i drag them out) will automatically use spline spline mesh 2. The way it currently works is that if I set spline point 3 to spline mesh 2, spline point 4 will automatically revert back the default spline mesh 1, I'll explain how the BP is set up.

    The spline mesh settings are driven by bool's defined in a struct, the struct is then brought into the spline BP as an array and made public, for each new spline point that's created a new array element is added to the struct array containing all of my bools, so each spline segment gets it's own individual settings index (array element). What's causing the problem is that for each new settings index/array element that's created, all the bools contained inside of it revert back to their default value of false which reverts the spline mesh back to default. The way I need it to work is that if I change a bool to true in one array element, that bool in each new array element after that one will maintain the same value of true until told otherwise. So again, the way I want it to work is that if I change spline point 4 to mesh 6, when I drag out spline point 5,6,7,8 etc they will automatically be mesh 6 instead of reverting back to the default mesh 1.

    I'm really pulling my hair out trying to figure this out, weather it's figuring out how to carry bool values from one array element to the next or a complete workaround, any help would be greatly, greatly appreciated.

    #2
    It should be pretty simple, when you add a new member to the array, you set its data with the data of the last member in the array.
    [Last Index] (Int) - (int) [Get] (Data) - (Data) [Add]

    Comment


      #3
      Right, I'll give that a try, thank you!

      Comment

      Working...
      X