Arrays not dropping data between play sessions?
Edit: Updated this question with new information.
My map generator recently began generating 2200 extra tiles on top of the 200 it was supposed to generate. For some reason these tiles were set to the last tile placed and were relaid over every vector in the map.
I think I see how it is generating extra tiles, but I am not sure why.
Possibly related to exposing and referencing my Vector Field in other blueprints? That is when the problems started.
I noticed in the level editor that if I select my map generator asset in the Scene Outliner, then it has a tab in the Details panel that shows my Vector Field.
Instead of 200 elements, it shows 2400 elements.... With a Map Size of 10, it generates 200 tiles(0-199). As you can see in the picture it starts over at 200. It generates 12 times for a total of 2400 tiles.
So essentially my ForEachLoop was running on a Vector Field that had 12 times more vectors than it was supposed to have, and after it ran through the first 200, it merely kept the last tile set and laid them out 11 deep on top.
In the Details panel, it allowed me to reset the variable to Default which cleared the 2400 elements in the vector field to 0 and allowed me to generate a map properly without using the Do N nodes to cull the generation.
I am afraid that it will happen again and fill my Vector Field with garbage vectors. Apart from setting a ClearArray node in front of my Vector Field Generator, anyone know how to stop this from happening again?
If you intend to generate this array each time you run, you probably want to set your array to be transient. If it is a blueprint variable, you can do this in the Details window, behind the arrow-down in the advanced options.
answered May 08 '14 at 12:30 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here