4.6 broke my macro

Hello,
In my project, i’m using a macro i made to create a reload function. I made it as macro because functions dont support multi exec output.
This macro is working fine in 4.5 and older, but since i updated to 4.6, i get this.

So i took a look inside the macro itself, and i get this.

Once again it was working fine in previous version of the engine.

Hi ,

There is a known issue with variable references breaking in the 4.5.1 to 4.6 migration, go through your list of variables and make sure they all have a value and that none are null. If they are you may have to replace the variable or reset the value.

Ok, thanks, gonna try that right now. Could you link me the page of the topic if it exists ? I’ve been searching through the forum and the answerhub but with no specific result (maybe i searched for a too specific one).
I keep you informed.

i just tried and i still get the error :frowning:

It looks like this was discovered internally. If I find an answerhub thread with more information, however, I will be sure to link it here.

Just to test and see if it could be an error with macros in general, can you try to recreate the macro itself and see if the new macro gives you the same error?

I tried creating a new dummy macro, with only inputs connected to outputs. I get no error with it when i compile the blueprint
The editor crashed when i broke links to it though. I reopened it and retry, and it passes.
The weird thing is that i can’t create local variables in macro-library, so i can’t redo the macro-function.
I could try in a function library, but it doesnt support multiple execution outputs. I will try to do it anyway, and set a bool instead of execution. But that’s only a workaround :-/

Hi ,

If you are comfortable with it, can you send me a link to your project? I would be happy to take a look and see what might be occurring.

I just checked, you won’t need the whole project, only the macro will be fine.
link text

Create a new project, go in any blueprint event graph, right click and type for Reload. You should see a macro “Reload Calc”, place it and connect the exec input.
Now, if you compile the BP, you will have an error like “Could not find varaible named “Clip Ammo” in 'BPname_C”, Make sur 'BPname_C" has been compiled for"
same with Total Ammo and Max Clip Ammo

Not that surprising, so, you can create and connect them, and you will get the error i had initially.

Hi ,

I have great news. The macro you have is not broken due to a bug. It is broken because the functionality that you have in your macro is technically supposed to be in a function. Macro libraries are not intended to carry local variables, and as such the variables in your macro are technically null references (because they do not actually exist anymore). You can see this by right clicking on a pin and type “Promote to variable”. In a macro, even without context sensitivity turned on you will not be able to access this. What you will want to do is create a function library and simply move all of your function, which you can copy/paste over, into a function as opposed to a macro and make the 3 variables once more. After doing so you should not have this problem anymore.

Thanks,
The weird thing is that i could use the macro as function in 4.5 without any problems. I just had to place it from the right click menu and it gave me no error.
Well, anyway it is solved with function. But is there a way to create function with several execution input and output ? I currently must choose between function with only one exec but local variables, or macro with no local variables but several exec output…Is there any reason why we can’t do that ?

Hey , i’m coming back with another issue concerning that function.
So i created it as a function, and when i launch my project and hit play everything works fine, i can reaload my gun.
But when i open my gun’s BP, and save it, i get this error:
"Can’t save …/…/…/…/…/Projects/The Escape/TheEscape/Content/Blueprints/Weapons/Bertha.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)?"

And i also get this one
“BlueprintEditorCompileResults:Error: Error The current value (/Engine/Transient.REINST_NewFunctionLibrary_C_1) of the ’ Target ’ pin is invalid: /Engine/Transient.REINST_NewFunctionLibrary_C_1 isn’t a NewFunctionLibrary_C”

If i delete the function and place it again, it works. So everytime i open my project and make some change to a gun that has this function, i must delete the function and place it again…

Edit: Also, another weapon which use the same function has no problem.
I have checked on the answer hub but found no solution to this

Hi ,

Unfortunately at present it does not seem possible to add additional exec pins. I am going to enter a feature request for this. If you create a function that has a simple print string in it and add that to your blueprint does the same thing occur?

Seems like the.“transient” problem was coming from the gun bp, as the shotgun was working correctly. So I remade the gun bp and it works now.
Totally apart from that, scene and shapes components don’t inherit the actor’s transform. I searched on the answer hub but got no answer, so I wanted to know if you have a solution or whether I should open a thread. Same about movement input in character class seems to be broken (already opened a thread about this, if you could take a look :slight_smile: )

Hi ,

Definitely make a new report for the scenes and shapes components. This makes it easier for users who may have similar problems to find the error and add input or potential workarounds/fixes. I have assigned myself to your movement input bug and will check into it as soon as I can. This post is being marked as answered for tracking purposes.