No announcement yet.

Macro that converts dual channel exec to bool

  • Filter
  • Time
  • Show
Clear All
new posts

    Macro that converts dual channel exec to bool

    Background: wanted one of my input events to trigger different behavior based on whether the key was pressed or released, and wanted the difference in behavior to be encapsulated inside a single function. You then might say "why not just use a macro that has two exec inputs?", to which I would respond that due to the online nature of the game I required the behavior to be implemented on the server, and currently events do not support multi-exec inputs, so the solution was to either create two different replicated events (one for pressed, one for release), or create this macro and send the value of the output bool through a single replicated event, which is quite a bit tidier on the event graph. Probably has many other uses.

    It might be one less node but Macros create a lot of extra overhead through generated properties so in my opinion Macros should only be used when really necessary.

    Readability often suffers when multiple flows are merged together in my opinion so unless if exactly the same behavior is desired when Pressed and Released it would make more sense to me with two separate functions.

    Debugging is also easier because you can easily break on either press or release and the call stack would be more readable.
    Last edited by GarnerP57; 12-08-2018, 04:40 PM.