Reply To: Modular Design

FlowCanvas Forums Support Modular Design Reply To: Modular Design

#1164
stuffses
Participant

I ended up implementing Modular Macros myself, although I’m not very proud of the code. It’s a janky mess and I’m not even sure how it works, but hey it gets the job done for now!

Here’s the code for my Modular Macro Node:

The script will require some minor changes to the parent class, MacroNodeWrapper. I think it’s just marking some methods as virtual.

To use it, place the above node on your blackboard, and in the first “Macro” slot, provide it with the “Interface” macro. This “interface” Macro works much like a C# interface, in that it only defines the functions (or in this case, flow and value nodes for the macro) and should have no actual logic inside.

Once you’ve set the interface macro, refresh the ports.

To load modular macros, duplicate your interface macro and add logic to those new macros. You can then provide those new macros to the Modular Macro Node with a Blackboard variable.