quarta-feira, 1 de junho de 2016

BP Compendium 2: Macros

Macros


The use of a Macro allows the definition of a set of actions that can be called in other parts of the EventGraph. That way we avoid repeating this set of actions in the EventGraph simplifying its modification by being in one place.

To create Macros use the "MyBlueprint" tab and click the button with the "+" symbol next to the "Macros" category. The input and output parameters are specified in the "Details" tab. The type of parameter "Exec" is an Execution pin.



The image below shows a Macro called "StartGame". It is responsible for initializing the variable to a new match. It has a Boolean parameter called "Hard Mode" which increases the number of enemies if true.

Click to enlarge

To add the Macro to the EventGraph simply drag the name of the Macro and drop it in the EventGraph. When the Macro is executed, the actions that are in it will be executed. Because there are several ways to start a game, just use the Macro "StartGame" to initialize the variables instead of repeating these actions in different parts of the EventGraph.




Table of Contents