I’m lost…
Very cute solutions, but if the struct in question is implemented in C++,
THE PORTALS OF HELL WILL OPEN IN YOUR BLUEPRINTS
Due to this https://answers.unrealengine.com/questions/331268/struct-redefinition.html I had to rename a struct. Regreted every character add to its name.
Now I will need to reconnect and rebuild tons of nodes and pray that nothing will be left behind.
Does anyone have any tips?
I’ve also encountered some strange things with structs. Did you ever see something like this? The strange “REINSTs” are gone after restarting the editor:
It seems that the dropdown shows a “REINST” for every usage of the struct within my project. Absolutely strange…
…not very agile!
This used to work for me with my normal struct (not nested in another struct, no data tables, just a struct) whenever I changed something and everything breaks. So, since I always look this up and find this post when I have a similar error, this is what works for me:
- Change the struct
- Attempt to play the game so that the editor compiles all blueprints
- Hit cancel on the “several blueprints encountered errors” window
- Go to the blueprints that encountered errors and disconnect the red wires to whatever you changed
- Attempt to play the game again so that the editor compiles all blueprints
- Save all
Now you should be able to close the editor and re-open it again to continue working with your modified struct.
4.24 as well
Very late to the party, but this problem persists till now (4.25 / 4.26).
Another way to solve it (if affects one or two bps) is reloading the asset (right-click on bp → asset actions → reload).
It’s a very weird problem and builting a data-driven game can be anoying because of this behavior.
4.25 and 4.26 too
4.26.2 still persistent in heavy data-driven BPs
Don’t mean to resurrect an old thread but if anyone is finding this like I did, it might be helpful.
I had an array of structs in a game instance that was sent via a BPI to my save game. All I had to do was recompile and save the BPI itself and everything worked.
Not always viable. Sometimes there’s something you didn’t think of. Sometimes a new item is added to an inventory list. We shouldn’t have to plan around a broken system.
I don’t have this bug in 4.20 , I think this is because I use C++ for creating structs… even making big modifications didn’t break the nodes connected.
Just ran into this problem in 5.0.3. This makes structs non-viable in my opinion, I’m going to try Alexa.kl’s solution of using c++ structs first and if that doesn’t work I’ll move them all to blueprints.
Lmao, so you should basically plan out your ENTIRE development journey, because humans not only forget, but games in development evolve. Your approach isn’t possible, unless you’re creating a smaller sized game, or have a time machine. You can make any changes you want as long as you save ONLY the data table, close all tabs BUT leave the editor open
Press save, (Select DON’T SAVE! and tick all boxes.) Close the editor, re-open. You now have a modified data table/ struct with the original references intact. Been using this method for years. Lol. You ain’t gotta plan all of this nonsense out.
still broken
I think I found a fix. My experience was with an array of the changed structs being iterated over using a forloop and then feeding into CreateWidget nodes which had the struct exposed.
- Find the nodes that aren’t compiling and disconnect the struct as an input.
- Hover over that struct input and you should see Fallback Struct listed (see image below). This is your culprit. If you don’t see this, you are probably okay to reconnect the node.
- Now that you know which BP is causing the problems, navigate into that BP.
- Within that BP, delete the struct as a variable.
- Create a new variable that is the struct type you desire and replace all the references (to include in the other BPs as well).
- Recompile. Your game should be playable again and the problem fixed.
- To test: save, then reboot UE. You should not see the errors you once experienced.
I hope this helps everyone!
always create a dummy clone of a struct you wan to change and so modifications in dummy struct, after that replace the old struct with new one and delete the old one.
Changing the default value of a single integer in one of my structs led to an hour long rewiring and refresh-all-nodes session…
If you can use C++ then do that instead - maybe even use PrimaryDataAssets.
For anyone still having this issue where every time you change something in your struct you lose all your data on anything that uses that struct (especially with arrays or nested structs), I was finally able to find a workaround that worked for me!
If you get this free plugin: Refresh All Nodes it allows you to right-click on a folder and refresh all the nodes in all the blueprints within that folder.
So once you have installed that plugin and enabled it under “Edit → Plugins”, here is the workaround that worked for me:
- Hit “File → Save All” just in case.
- Make whatever changes you need to your struct, then save the struct.
- Right-click on whatever folder contains everything that uses that struct, for me I just use my “Blueprints” folder. Then hit “Refresh Blueprints”. It might take a minute depending on how large your folder is.
- Once it finishes, hit “File → Save All” again.
Now all your data should still be intact even after restarting the editor or experiencing a crash! Hope this helps!
Just tried this. You take less time just not saving and restarting the editor. I don’t think this plugin is useful for this problem. Probably is better to use this plugin that speed up the process for the workaround: Restart Unreal Editor | Fab