Organizing the script with macros and functions
When we are creating Blueprint scripts, sometimes, a group of actions is used in more than one place in Blueprint. These actions can be converted into macros or functions, simplifying the initial script because this group of actions will be replaced by only one node. Also, if you need to change something in this group of actions, this change will only be implemented in the macro or function rather than having to search every location where this group of actions was used. This is a good programming practice to use as it simplifies code and debugging.
Creating macros
To create macros, use the My Blueprint panel and click the + button in the MACROS category. The following screenshot shows the My Blueprint panel with a macro named SetupNewWave
:
When a macro is created, a new tab is opened in the same place as the Event Graph. This tab looks like the Event Graph but contains...