This might be a little long in order to explain exactly what I have set up. Hopefully someone can tell me what I’m doing wrong or do it a better way, but since the “breaks” in the blueprint logic only occurs sometimes… I’m kind of assuming its a bug with the editor, perhaps on load?
I have a master pawn actor called bsBall, that then has two children blueprints: bsBall_Enemy and bsBall_Player. I originally had made many children blueprints of bsBall_Enemy (ie: bsBall_Enemy_Bomber, etc) and had wrote most of their unique functionality in each.
However, later I decided I wanted to make my enemies more easily borrow logic from each other so I instead started making the children of bsBall_Enemy empty holders (enemy classes in name only) with which I spawned and attached child actors to them that adjusted their functionality (now I would spawn bsEnemy_Item_Bomber and attach it to the bsBall_Enemy, and now I have the ability to mix and match such functionality). I got that working pretty well and to make things easier I create an bsEnemyStruct with all the common variables I would need and a resulting bsEnemyDataTable.
So now in bsBall_Enemy, on BeginPlay I have each enemy get its display name, find its matching row name in the bsEnemyDataTable, get all the variables from that row and then assign those values to the matching values in the actor. So, on BeginPlay bsBall_Enemy_Bomber would spawn, get its display name bsBall_Enemy_Bomber, find the corresponding row in the data table, grab all the values, assign them to itself, and we’re done.
However, some of the variables in my DataTable that are assigned are the Child Actors mentioned above, the components that I can assign to give each enemy different functionality. My problem is, is that after a few hours or when I come back to my project to do some work all my bsBall_Enemy blueprints will be broken and it happens in my function in that blueprint where I am getting all the information from the DataTable. For some reason the variable links for the Child Actors break. The execution links remain but the links between my Child Actor variables aren’t there… which breaks my blueprint and every subsequent blueprint based on it.
There are other things that break as well, like a user widget I spawn… but I’m chalking that up to just the parent blueprint not working and it freaking out.
I hope this made sense, any help would be greatly greatly appreciated.
My bsEnemyStruct. If you notice at the bottom, NavMode through EnemyItem5 are all placed with a default. I originally assumed the breaks were happening because the Struct didn’t have a default, doesn’t seem to be the case.
My bsEnemyDataTable
My parent bsBall_Enemy getting and setting variables on BeginPlay
Inside the function in previous image, Get Enemy Data Table Info. This is where the break happens (sometimes). You can see I’m casting to a class, that is the main parent for all the Child Actors I’ll be setting.