[4.6.1] Calling blueprint function library function inside macro library causes crash in standalone

I was getting a crash in my project on launching standalone from the editor and I narrowed it down to a macro in a blueprint my macro library calling a function in my blueprint function library. I was getting these log messages when it happened:

[2015.01.08-19.17.25:701][ 0]LogBlueprint:Error: [compiler] Error The current value (/Engine/Transient.REINST_Core2FunctionLibrary_C_0) of the ’ Target ’ pin is invalid: /Engine/Transient.REINST_Core2FunctionLibrary_C_0 isn’t a Core2FunctionLibrary_C (specified on pin self)

I had to set a breakpoint in KismetCompilerMisc.cpp, Line 944 where the error message is generated and then inspect the Node to see what function it was actually talking about. My full log is in here [FullProjectLog.zip][1].

In order to fix it, I had to remove the call to the blueprint function library function and pass the information into the macro library macro.

Is calling blueprint library functions not allowed in macro library macros? My expectation is that it would be supported or at least prevented by the editor.

I tried to repro this in SwingNinja. I could get a crash, but it doesn’t crash in the same way. The log for SwingNinja crash is here: [SwingNinjaLog.zip][2]

To repro:

  1. Create a Blueprint Function Library with a function “Get Character Box Component”, taking a “Character” type input. Defined like this:

  1. Create a Macro Library based on Actor with a macro “GetMyCharcterBoxExtents” taking a “Character” type input. and Vector output. Defined like this:

  1. Modify the Coin blueprint after the PlaySoundAtLocation call like this:

  1. Launch in PIE, notice print string when picking up coin is appearing and no crash.

  2. Launch in Stand Alone, notice crash when picking up coin.

Hi CombatJack,

Thanks for the report! I was able to reproduce this crash internally and have created a bug report for the developers to look over (UE-7334). I would expect a function from a Function Library to work inside a macro from a Macro Library as well, and it seems to work most of the time but not in Standalone Game. For now, your workaround is your best bet. I will let you know when I see an update on the bug report. Thanks!

What is the status of UE-7334? I am getting the identical error message every time I re open my project and it is only fixed by re-compiling the function libraries in question.

There hasn’t been any update on UE-7334 yet, and I would expect it to be looked into for 4.8. That bug report may be related to the issue you’re having, but it specifically looks at the crash in Standalone that happens as a result, and not a compiler error. We’ll address that in your other post:

Thanks!

Hi Ben,

just lost about 6 hours because of this (nearly went crazy about it). I was just calling a function lib inside a macro which caused the editor to crash. The really strange thing: It looks like it has something to do with the order in which individual blueprint gets compiled.

Maybe you could just throw a warning that this could cause a crash? From the crash log I could absolutely not tell what was the actual problem here…

Sorry about that! I believe this has already been fixed in our internal build, so it should work without crashing in 4.9, however I have yet to verify that. I’ll post here when it’s been verified.