I’ve got a character class that inherits from another character class.
In the parent class I want to create a macro that can be used in the child class, but I can’t seem to get that to work. Making a function within the parent class however, will show the function in the child class…
Aren’t macro’s supported for inheritance (yet)? Or am I just doing something plain wrong.
Help is appreciated.
The thing is, with Blueprint macro’s you can create a node without any Execution pins (which is what I want). A new function always forces you to have an execution pin.
Maybe you can explain your situation in complete detail? Do you have to have no executions pins? And what does this have anything to do with inheritance? Blueprint is written by C++, and in C++ only struct and class can apply the concept of inheritance. So macro will never support inheritance. If you look into what macro really is you will understand why. Besides, macros are a very old and outdated concept, but it still has its place in the world of progrmaming
in that case I think you have to have execution pins. so in C++ (all languages), codes are executed line by line. In blueprint the order is specified by executions pins. So if you don’t connect execution pins to blueprint node, that node won’t be executed. it can’t just run independently. I haven’t done macros in blueprints and I don’t find the need to. In one word, just do it the normal way
I have the same problem - I guess I will have to separate macros out into a library. really want those macros to be just associated with that class though…
Why are you sticking to macros then? If you need a node that does some calc without EXEC pins, then just make a function and check ‘Pure’. Solved. Can be inherited. Can be overridden. Can call parent if need be. Everything works.
This is still a serious oversight in the Engine design.
A child cannot use the macros of a parent for… reasons.
Okay? I’ll make a macro library.
A parent cannot use it’s own macro library for… reasons.
Therefore: All macros must be made twice.
I thought the whole point of making macros and functions was to cut down on work, not double it. At this point I’m better off copy-pasing these nodes over and over again.
For this you can make a BP function and tick its “pure” box. Then it will have no execution pins and will act like, for example, the built in Get Player Controller. The deal is that a pure function should not modify any class variables.
I agree that macro inheritance is needed but for the opposite reason, I need a base class function to end with an Anim Montage playing and so need multiple exec output pins which a macro can do but a function cannot.
This doesn’t solve for cases like having a latent node, which can only be placed in an event graph. In my case I have a macro in a parent Ability BP that contains Play Montage and Wait For Event, which was supposed to make it convenient to drop a single macro to basically translate a montage. However, I either have to copy and paste this macro to all children, or I have to do this via a separate function I have to manually plug into the play montage every time. Not a giant inconvenience, but it is one, and I do not see it as being exactly necessary given that it could be solved as simply as having macros be inherited from parent.