Hello,
So ive been using unreal for a few years now, and so far i love it. However now this will be the third time i have redone my main hud for my game. the problem is i code only in variables, and structures help me alot. But i have had to learn so many ways to fix all the bugs and crashes from simply adding new variables to a structure thats in use. Now though im running into the no compile no save crash from the result of me changing up my pre done structures leaving me with my only option but to gut my code of all structures and think far ahead into the future and make every single structure now that ill ever use (seeing as they are all interconnected)
for someone that changes his mind on the fly this is not ideal. So my question is are devs working on a way to stop this crash, or is there other methods that i could be using.
Hey Red-Wolfy
Trust me, I’ve had this problem too and I’m pretty sure it’s a pretty common one. I’ve been using the engine and dealing with the issue since v 4.6 and it hasn’t been fixed so I wouldn’t hold your breath lol.
The best way that I’ve been able to get around it is to move all of my structs down to C++. If you’re someone who’s BP only, I’d still at least move your structs down. It’s not that hard to write basic properties and the community wiki (moved to https://www.ue4community.wiki/ JIC you or someone else doesn’t know yet) has a bunch of sample code that you can look at to figure it out. I only had a few C classes for engineering stuff in college when I started so I barely knew anything and I figured it out so I’m sure you can too!
You’ll still get errors when changing values, but I’ve usually been able to fix them by refreshing the nodes that reference the struct and recompiling/resaving the blueprint afterward. It’s a little much, but I also create a static library for each module that has it’s own custom types to keep references to the struct’s actual properties away from blueprints. That just makes it a bit easier to deal with compiler errors when the value changes so you don’t have to do it if you don’t want to.
I’m also using 4.24 now so if you’re on an earlier version I don’t know how much luck you’ll have. I never managed to fix it on earlier versions.
There’s also a little ‘hack’ you can try.
Basically you duplicate the struct and use the replace references tool to replace the references from the old one to the new one. Then you should see a popup asking to remove structs of invalid types, say yes to that and it should be resolved. I haven’t used that one for a few years though so idk if it’s still reliable.
Here’s the wiki link for C++ structs JIC you need it.
https://www.ue4community.wiki/Legacy/Structs,_USTRUCTS(),_They're_Awesome
I hope you get everything fixed up!
Ah, thanks eh yea ive been trying that hack aswell but it crashes when it tries to find the refferences like its tripping over itself simply loading it haha. Ill try my hand at c++ again though i new you could turn your actors and blueprints into c++ but i didnt think structures aswell. Ill have to give it a try now. Hopefully there will be a fix in ue5 if all else fails :3
Hey sorry for the late reply. I think you’re talking about the nativization tool, but I mean literally re-writing them in C++. I’ve had it crash on me too while finding references. It could mean an asset is corrupted (one that references the struct) or you could he running out of resources while searching. If that happens your OS will crash the editor. Do you get the crash report client when it crashes or does the editor just turn off?
Hello So I’m posting this in my answer cause I found an easy solution that I wish to share with everyone who has this same issue. Now I don’t know if this helps with removing or changing existing variables within the structures, but I was having more problems with my game and I tried a new workaround. Since I was just starting my code I only had 2 assets to worry about that I new was crashing on reference. I had a structure that needed another variable but would crash when i hit the new button. so i went into the game content folder and moved the 2 main assets to my desktop and re-ran the game. sure enough, it let me change the structure. then when i was done i placed the assets back into their original folders and reloaded the game. No Crashes, No Errors. I compiled, saved, everything without any problems!!
This is the most annoying bug in UE4 and it’s still very buggy also in 4.26.2. If I would wish one fix for UE4, then this would be the first one. Working with structs is ■■■■ at the moment, because editing it bring up so much work because of refresh/reloading everything manually.
Hey! That helped! Thank you!
Same issue in 5.3 after changing a struct. What helped for me was to close the project, find the .uasset files in windows explorer and copy them into an empty UE5.3 project. I then reverted the changes, saved, and replaced the original files with the modified files (all in windows explorer).