Download

Is there a good way to modify a struct that is already in use so that it doesn't break everything?

I have a struct I’m using for item data and right now it’s in use in several places. I had previously tried to add another variable to the struct and it completely broke every place the struct was being used. For some reason even when I put it back to how it was every single reference to the struct generated error after error. I needed to restore from a backup of my while project and re-do a couple days of work just to get it going again.

But now I’m back to my original problem. I have a struct with four variables, I want to add a fifth. I wouldn’t think the editor should have a problem with this considering I am not removing or modifying anything that is currently in use but it will. Is there a way to do this that doesn’t cause me to need to restore from a backup?

Thanks

What version of the engine are you using?

4.11.1 . There’s also a 10 character requirement for posts. Soo… yeah.

Not entirely sure. Just tested on my end in a 4.11 project. When I changed the struct, nothing was throwing errors although my functionality was no longer working. I’d look into running a local Perforce if you can, should avoid having to redo days of work.

It’s annoying, but I create a comment with a tag word to search for later in places where I break the struct. It’s the only way I know how to do it.

Did you need to physically remove/replace every reference to the struct or just re-attach the pins to the updated struct?

just attach the new pins

Ok, it looks like as long as you’re just adding a new variable and leaving the rest alone, it will not disconnect any nodes that are already in use (confirmed with both “set members in struct” and “break struct”). I must have accidentally modified one of them earlier to break everything.

Thanks for the help everyone.