I sometimes get the error below when trying to save my CritterFlee Behavior Tree Service Blueprint:
Can't save ../../../../../../Users/Xarol/Documents/Unreal Projects/AnimalRescue/Content/Blueprints/Critters/CritterBehaviour/CritterFlee.uasset: Graph is linked to private object(s) in an external package.
External Object(s):
/Engine/Transient
Try to find the chain of references to that object (may take some time)?
I then click OK and try to compile which fails with the following message:
Error Default value '/Engine/Transient.REINST_UtilityFunctionLibrary_C_1' for Target is invalid: '/Engine/Transient.REINST_UtilityFunctionLibrary_C_1 isn't a UtilityFunctionLibrary_C (specified on pin self)'
I then open a blueprint function library that my service depends on, compile and save that and then I am able to compile and save the CritterFlee.
This seems like a bug to me in the sense that everything compiles successfully but I seem to have to do it in a certain order.
Also, my utility function gives the following warning
Warning Function ' Get All Actors Of Class ' is unsafe to call from blueprints of class ' BlueprintFunctionLibrary '.
So my questions are:
What can I do so that I can compile/save my CritterFlee blueprint without having to first open/save/compile my BluePrintFunctionLibrary.
Why is it unsafe to call ’ Get All Actors of Class’ in a library?
This is caused by a logical loop, but can be solved by finding a different method of transferring information. Normally you can replace certain function calls/references with interface functions or event dispatchers (depending on what you want to do.)
Can you show me exactly what is going on in the blueprint? A few screenshots may help with debugging the exact cause. Any additional information may help.
Why is it unsafe to call ’ Get All
Actors of Class’ in a library?
I am not sure off the top of my head, but I will find out.
I tried viewing references but didn’t see a circular dependency. I don’t know how to export the offending blueprint as an image. It’s a big blueprint so a screenshot will probably be too small to see what is going on. How can I export a slightly large blueprint to show you?
There is one thing that you can do; copy the blueprint nodes, then paste them as text into a word document and then submit that. I would probably also need to see some sort of image for context, but at least that way I would have the entire node structure.
Also, how will an interface help me
here?
Without more details I couldn’t say specifically. Depending on the way that the blueprints are interacting with eachother, sometimes an interface will work better. I would need some more details about the blueprint to get a good assessment of that.
I have an example of a working and failing-to-compile node, which happens when I try to change a setting somewhere else in the game. The node is being called in the project and is part of a blueprint function library.
Both are looking for GameFunctionLibrary.GameFunctionLibrary_C, but the failing node’s default object is REINST_GameFunctionLibrary_C_1 …? I dunno.
UPDATE: Noted in the previous reply, I tried changing the REINST_GameFunctionLibrary_C_1 to GameFunctionLibrary_C and it fixed the node compiling. As for the “PinType= …” stuff in this comment, I tried ALSO changing the line there to “GameFunctionLibrary_C_1” to match the REINST_GameFunctionLibrary_C_1 (i.e. the opposite fix), and it also compiled fine.
What is happening is a file is being referenced, then it is moved, so a “Reinstantiation” or “re-director” is left behind to direct anything pointing to that location. Sometimes an asset can be moved in a way that confuses the pointers or loops around on itself, which causes the REINST error to appear. It can be worked around by manually changing the code to look in the correct locations or by changing the method of transferring information. It’s something that is deeply rooted in UE4 to help with moving assets and we are always working to improve it so this occurs less frequently.