Reply To: Call Function from other Flow

FlowCanvas Forums Support Call Function from other Flow Reply To: Call Function from other Flow

#1852
Gavalakis
Keymaster

Hello and welcome to the forums.
Thanks for purchasing FlowCanvas and I am glad you like it!

While indeed the “normal” way of communicating between different flowscripts, is the Event Nodes, here is an alternative solution that would work better in such a case.

1. Create a normal “Custom Function” (Functions/Custom/New Custom Function) in target flowScript.
CustomFunction

2. In the other flowScript from which you want to call this function from, drag and drop the target flowScript (containing the custom function) into the canvas. This will popup a selection menu. from that menu, select “FlowScriptController/Methods/Call Function”.
DragDropGameObject
This method, is basically able to call a custom function created in the flowScript.

3. Give the correct name of the function to call (in this example just “MyFunction”) and optionally, use the “Expose Parameters” option, which will expose the params object[] to individual ports and which can be very useful!
CallFunctionInspector

4. Make some connections.
Call-Function

That’s it.
There are of course some downsides in this solution, like for example working with string function names and object type parameters (instead of strongly typed, but it is still a valid solution 🙂
I could make a dedicated custom node like “Call External Function” to handle these things easier though.

Let me know if that works for you as expected.
Thank you!

Join us on Discord: https://discord.gg/97q2Rjh

Attachments:
  1. CustomFunction.png

  2. DragDropGameObject.gif

  3. CallFunctionInspector.png

  4. Call-Function.png