Skip to content

Call Blueprint Owner Function

Krzysiek Justyński edited this page Jun 16, 2024 · 3 revisions

Deprecation note

This feature became deprecated with the introduction of Flow AddOns wiki

Description

This allows us to call blueprint functions on owning objects from the Flow Graph. This is quite a significant feature added by contributed by LindyHopperGT.

  • UFlowAsset has an ExpectedOwnerClass property. This is used to scrape the eligible callable functions from. In practice, the Flow Graph can be owned by this class or any subclass and the functions will still bind correctly.
  • The DefaultExpectedOwnerClass can be configured in the Flow project settings (defaults to UFlowComponent, which has no functions, so you'll likely want to change it)
  • Owner classes must implement IFlowOwnerInterface to be findable in the ExpectedOwnerClass drop-down.
  • The CallOwnerFunction FlowNode can select an eligible function and allow the author to configure the params object
  • The eligible functions accept a single "Params Object" input parameter. This is subclassable to add additional variables and define the pins for the Flow Ndoe.
  • Pins for CallOwnerFunction are auto-populated with those defined by the function's params object.
  • If the new Adaptive Node Titles feature is enabled, the CallOwnerFunction title will update to include the function name.
  • The eligible functions return an output pin name to trigger (or None, if no pin should be triggered).
  • The Params Object class can override blueprint functions for Pre and Post Execute, to fill in dynamically sourced parameters.
  • The Params Object class may also override a blueprint function to determine if an output pin should "Finish" the node (the default is true).

Example

  • See the example Flow Component that has three functions: DanceParty, StayOutAllNight, and BoringFunction.
  • There are 2 example params objects: ExampleFlowOwnerParams and TimerFlowOwnerParams.
  • DanceParty and StayOutAllNight both accept the TimerFlowOwnerParams.
  • BoringFunction accepts the ExampleFlowOwnerParams.
  • DanceParty and BoringFunction blueprints showcase how to access the input names, the executed input name, the output names, and other user-defined properties from the params object.

FlowOwnerFunctionDemo ExampleFlowOwnerParams TimerFlowOwnerParams DancePartyFunction BoringFunction