Blueprint Macro Inheritance

Hey guys,

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.

by definition macros in C++ don’t support inheritance. It doesn’t make sense. What macro does is pure text copy and paste before compile time.

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

I need my Blueprint node to just do a calculation, such as the node, which has no execution pins and just calculates inputs and gives an output.

In this instance I could live with an execution pin, but I’d rather not. It would just be connecting another wire without actually needing it to.

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.

Macro inheritance makes no sense, as it was said.

1 Like

It does make sense in some cases. What if you make a macro with a delay inside and you want to reuse that macro in a child blueprint?

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.

2 Likes

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.

1 Like