As they say, a picture is worth a thousand words, so let me fill up this post with 3,000 of them (words :p).
Here is the entire construction script. When I measured the length of the array between each (using a length -> Set variable) it remained the same before and after the remove index. I also tried using a Remove Name, and the same thing occured.
The construction script is not removing the index / name from the array, and since I am using a random stream, it is placing the hallway and cap at the same socket location >.< Anyone having issues with this, or is there something wrong with my methodology?
Your methodology looks fine to me. If I had to guess, it would be that somewhere between the graph and your functions, the actual reference to the room sockets array is lost, and it just becomes an array with no stored reference. Try using room sockets directly on the remove index node.
Ok, so I found the issues with the blueprint… it basically comes down to (what I believe) is a bug in the way functions handle variables, namely, setting them. It just doesn’t work.
So, I had to dis-functionize (yay, I just created a new word!) all of the functions and put everything into the main blueprint.
Ok, well, I thought that fixed the issue, but even after taking everything out of the functions, the length test I am performing on the array remains the same before and after the remove index
So I have it fixed in the blueprint viewport, but it’s still doing the same thing (keeping both the cap, seam, and hallway at socket index 0).
Aaah… the natural evolution of debugging… I found an issue where Get All Socket Names is not properly returning an array of socket names (Each room has at least 2 sockets).
Ok, so I saw something that I added, and I can’t remember what (including the resize). I think I was missing a Set on the SocketName name variable. I also created 2 int’s for length tests. When I did all of that, when I did a resize length - 1, it gave me an array with 0 entities (the original length = 2, then I removed (which left 1), after resizing, then 0… so I unhooked the resize.
Now, I am able to generate a Room, Cap, Hallway+Seam correctly… except…
I’ve tested 20 or so initial seed values for the generator, however, seed value 512 just gives me a room, no cap, no seam, nor hallway. Wtf?
Lol, it’s unlikely, but it could be that the number is a power of 2, try seed 1024. The only reason I mentioned this is that the chat system I am working on craps out and disconnects everyone from the game if a chat message reaches 1024 characters in length, just a thought.