[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 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 current value (/Engine/Transient.REINST_Core2FunctionLibrary_C_0) of ’ 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 error message is generated and then inspect Node to see what function it was actually talking about. My full log is in here [FullProjectLog.][1].

In order to fix it, I had to remove call to blueprint function library function and pass information into 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 editor.

I tried to repro this in SwingNinja. I could get a crash, but it doesn’t crash in same way. log for SwingNinja crash is here: [SwingNinjaLog.][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 Coin blueprint after 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

Thanks for report! I was able to reproduce this crash internally and have created a bug report for 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 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 bug report. Thanks!

What is status of UE-7334? I am getting identical error message every time I re open my project and it is only fixed by re-compiling 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 issue you’re having, but it specifically looks at crash in Standalone that happens as a result, and not a compiler error. We’ll address that in your other post:

Thanks!

Hi ,

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 editor to crash. really strange thing: It looks like it has something to do with order in which individual blueprint gets compiled.

Maybe you could just throw a warning that this could cause a crash? From crash log I could absolutely not tell what was 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.